Skip to content

Commit bb7abe5

Browse files
committed
add treeviewmodel, name some variables
1 parent a4019b1 commit bb7abe5

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

55 files changed

+203
-137
lines changed

Common/Logging/LogLevel.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
namespace OpenLoco.Common.Logging
22
{
3-
public enum LogLevel { Debug2, Debug, Info, Warning, Error };
3+
public enum LogLevel { Debug2, Debug, Info, Warning, Error }
44
}

Dat/Data/Colour.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ public enum Colour : uint8_t
3434
Pink = 29,
3535
MutedRed = 30,
3636
MAX,
37-
};
37+
}
3838

3939
public enum ExtColour : uint8_t
4040
{
@@ -187,5 +187,5 @@ public enum ExtColour : uint8_t
187187
unk91,
188188
unk92,
189189
MAX,
190-
};
190+
}
191191
}

Dat/Data/LanguageId.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,5 +18,5 @@ public enum LanguageId : uint8_t
1818
Portuguese,
1919
//blank = 254,
2020
//end = 255
21-
};
21+
}
2222
}

Dat/Data/OriginalDataPathIds.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,5 +58,5 @@ public enum OriginalDataPathIds : uint8_t
5858
_1tmp,
5959
objects,
6060
scenarios,
61-
};
61+
}
6262
}

Dat/Data/SoundId.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,5 +35,5 @@ public enum SoundId : uint16_t
3535
Breakdown5 = 30,
3636
Breakdown6 = 31,
3737
NULL = 0xFF
38-
};
38+
}
3939
}

Dat/FileParsing/ByteHelpers.cs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
using System.Runtime.InteropServices;
2+
13
namespace OpenLoco.Dat.FileParsing
24
{
35
public static class ByteHelpers
@@ -17,6 +19,10 @@ public static int GetObjectSize(Type type)
1719
{
1820
size = 4;
1921
}
22+
else if (type.IsEnum)
23+
{
24+
size = Marshal.SizeOf(type.GetEnumUnderlyingType());
25+
}
2026
else
2127
{
2228
var sizeAttr = AttributeHelper.Get<LocoStructSizeAttribute>(type) ?? throw new ArgumentOutOfRangeException(nameof(LocoStructSizeAttribute), $"type {type} didn't have LocoStructSizeAttribute");

Dat/Objects/Airport/AirportMovementNodeFlags.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,5 +12,5 @@ public enum AirportMovementNodeFlags : uint16_t
1212
TakeoffBegin = 1 << 6,
1313
HeliTakeoffEnd = 1 << 7,
1414
Touchdown = 1 << 8,
15-
};
15+
}
1616
}

Dat/Objects/BridgeObject.cs

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -61,10 +61,7 @@ public record BridgeObject(
6161
public const int MaxNumTrackMods = 7;
6262
public const int MaxNumRoadMods = 7;
6363

64-
[LocoPropertyMaybeUnused]
6564
public List<S5Header> CompatibleTrackObjects { get; set; } = [];
66-
67-
[LocoPropertyMaybeUnused]
6865
public List<S5Header> CompatibleRoadObjects { get; set; } = [];
6966

7067
public ReadOnlySpan<byte> Load(ReadOnlySpan<byte> remainingData)

Dat/Objects/BuildingObject.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ public enum BuildingObjectFlags : uint8_t
1414
MiscBuilding = 1 << 1,
1515
Indestructible = 1 << 2,
1616
IsHeadquarters = 1 << 3,
17-
};
17+
}
1818

1919
[TypeConverter(typeof(ExpandableObjectConverter))]
2020
[LocoStructSize(0xBE)]

Dat/Objects/CargoObject.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ public enum CargoObjectFlags : uint8_t
1212
unk0 = 1 << 0,
1313
Refit = 1 << 1,
1414
Delivering = 1 << 2,
15-
};
15+
}
1616

1717
public enum CargoCategory : uint16_t
1818
{
@@ -32,15 +32,15 @@ public enum CargoCategory : uint16_t
3232
Mail = 13,
3333
// Note: Mods may (and do) use other numbers not covered by this list
3434
NULL = (uint16_t)0xFFFFU,
35-
};
35+
}
3636

3737
[TypeConverter(typeof(ExpandableObjectConverter))]
3838
[LocoStructSize(0x1F)]
3939
[LocoStructType(ObjectType.Cargo)]
4040
[LocoStringTable("Name", "UnitsAndCargoName", "UnitNameSingular", "UnitNamePlural")]
4141
public record CargoObject(
4242
[property: LocoStructOffset(0x00), LocoString, Browsable(false)] string_id Name,
43-
[property: LocoStructOffset(0x02), LocoPropertyMaybeUnused] uint16_t var_02,
43+
[property: LocoStructOffset(0x02)] uint16_t var_02,
4444
[property: LocoStructOffset(0x04)] uint16_t CargoTransferTime,
4545
[property: LocoStructOffset(0x06), LocoString, Browsable(false)] string_id UnitsAndCargoName,
4646
[property: LocoStructOffset(0x08), LocoString, Browsable(false)] string_id UnitNameSingular,
@@ -49,7 +49,7 @@ public record CargoObject(
4949
[property: LocoStructOffset(0x10)] CargoCategory CargoCategory,
5050
[property: LocoStructOffset(0x12)] CargoObjectFlags Flags,
5151
[property: LocoStructOffset(0x13)] uint8_t NumPlatformVariations,
52-
[property: LocoStructOffset(0x14), LocoPropertyMaybeUnused] uint8_t var_14,
52+
[property: LocoStructOffset(0x14)] uint8_t StationCargoDensity,
5353
[property: LocoStructOffset(0x15)] uint8_t PremiumDays,
5454
[property: LocoStructOffset(0x16)] uint8_t MaxNonPremiumDays,
5555
[property: LocoStructOffset(0x17)] uint16_t MaxPremiumRate,

0 commit comments

Comments
 (0)