From a0ed028669442a9a2e2f5c6f5292d5ccfb01d842 Mon Sep 17 00:00:00 2001 From: sk-zk Date: Sun, 3 Mar 2024 00:16:37 +0100 Subject: [PATCH] Hide internal flag field --- TruckLib/ScsMap/Node.cs | 36 ++++++++++++++++++------------------ 1 file changed, 18 insertions(+), 18 deletions(-) diff --git a/TruckLib/ScsMap/Node.cs b/TruckLib/ScsMap/Node.cs index 7b45c64..5f38568 100644 --- a/TruckLib/ScsMap/Node.cs +++ b/TruckLib/ScsMap/Node.cs @@ -62,15 +62,15 @@ public Quaternion Rotation /// public IMapObject ForwardItem { get; set; } - protected FlagField Flags; + private FlagField flags; /// /// Gets or sets if this node is red or green. /// public bool IsRed { - get => Flags[0]; - set => Flags[0] = value; + get => flags[0]; + set => flags[0] = value; } /// @@ -79,8 +79,8 @@ public bool IsRed /// public bool FreeRotation { - get => Flags[2]; - set => Flags[2] = value; + get => flags[2]; + set => flags[2] = value; } /// @@ -88,8 +88,8 @@ public bool FreeRotation /// public bool IsCountryBorder { - get => Flags[1]; - set => Flags[1] = value; + get => flags[1]; + set => flags[1] = value; } /// @@ -97,8 +97,8 @@ public bool IsCountryBorder /// public bool IsCurveLocator { - get => Flags[3]; - set => Flags[3] = value; + get => flags[3]; + set => flags[3] = value; } /// @@ -106,8 +106,8 @@ public bool IsCurveLocator /// public bool Locked { - get => Flags[26]; - set => Flags[26] = value; + get => flags[26]; + set => flags[26] = value; } /// @@ -115,8 +115,8 @@ public bool Locked /// public byte BackwardCountry { - get => Flags.GetByte(2); - set => Flags.SetByte(2, value); + get => flags.GetByte(2); + set => flags.SetByte(2, value); } /// @@ -124,8 +124,8 @@ public byte BackwardCountry /// public byte ForwardCountry { - get => Flags.GetByte(1); - set => Flags.SetByte(1, value); + get => flags.GetByte(1); + set => flags.SetByte(1, value); } /// @@ -157,7 +157,7 @@ protected virtual void Init() { Uid = Utils.GenerateUuid(); rotation = Quaternion.Identity; - Flags = new FlagField(); + flags = new FlagField(); } /// @@ -353,7 +353,7 @@ public void Deserialize(BinaryReader r, uint? version = null) var fwItemUid = r.ReadUInt64(); ForwardItem = fwItemUid == 0 ? null : (IMapObject)new UnresolvedItem(fwItemUid); - Flags = new FlagField(r.ReadUInt32()); + flags = new FlagField(r.ReadUInt32()); } /// @@ -373,7 +373,7 @@ public void Serialize(BinaryWriter w) w.Write(BackwardItem is null ? 0UL : BackwardItem.Uid); w.Write(ForwardItem is null ? 0UL : ForwardItem.Uid); - w.Write(Flags.Bits); + w.Write(flags.Bits); } ///