Skip to content

Commit

Permalink
name building.var9F, fix unit tests
Browse files Browse the repository at this point in the history
  • Loading branch information
LeftofZen committed Mar 20, 2024
1 parent 9e47188 commit 7da5af2
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion Core/Objects/BuildingObject.cs
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ public record BuildingObject(
[property: LocoStructOffset(0x9C)] uint8_t ScaffoldingSegmentType,
[property: LocoStructOffset(0x9D)] Colour ScaffoldingColour,
[property: LocoStructOffset(0x9E)] uint8_t GeneratorFunction,
[property: LocoStructOffset(0x9F)] uint8_t var_9F,
[property: LocoStructOffset(0x9F)] uint8_t AverageNumberOnMap,
[property: LocoStructOffset(0xA0), LocoStructVariableLoad, LocoArrayLength(2)] List<uint8_t> _ProducedQuantity,
[property: LocoStructOffset(0xA2), LocoStructVariableLoad, LocoArrayLength(BuildingObject.MaxProducedCargoType), Browsable(false)] List<object_id> _ProducedCargoType,
[property: LocoStructOffset(0xA4), LocoStructVariableLoad, LocoArrayLength(BuildingObject.MaxRequiredCargoType), Browsable(false)] List<object_id> _RequiredCargoType,
Expand Down
10 changes: 5 additions & 5 deletions Tests/LoadSaveTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ void assertFunc(ILocoObject obj, BridgeObject struc) => Assert.Multiple(() =>
Assert.That(struc.BaseCostFactor, Is.EqualTo(16), nameof(struc.BaseCostFactor));
Assert.That(struc.HeightCostFactor, Is.EqualTo(8), nameof(struc.HeightCostFactor));
Assert.That(struc.SellCostFactor, Is.EqualTo(-12), nameof(struc.SellCostFactor));
Assert.That(struc.DisabledTrackCfg, Is.EqualTo(0), nameof(struc.DisabledTrackCfg));
Assert.That(struc.DisabledTrackFlags, Is.EqualTo(BridgeDisabledTrackFlags.None), nameof(struc.DisabledTrackFlags));
//Assert.That(struc.TrackNumCompatible, Is.EqualTo(0), nameof(struc.TrackNumCompatible));
//CollectionAssert.AreEqual(struc.TrackMods, Array.CreateInstance(typeof(byte), 7), nameof(struc.TrackMods));
//Assert.That(struc.RoadNumCompatible, Is.EqualTo(0), nameof(struc.RoadNumCompatible));
Expand Down Expand Up @@ -170,7 +170,7 @@ void assertFunc(ILocoObject obj, BuildingObject struc) => Assert.Multiple(() =>
Assert.That(struc.ScaffoldingSegmentType, Is.EqualTo(1), nameof(struc.ScaffoldingSegmentType));
Assert.That(struc.ScaffoldingColour, Is.EqualTo(Colour.Yellow), nameof(struc.ScaffoldingColour));
Assert.That(struc.GeneratorFunction, Is.EqualTo(3), nameof(struc.GeneratorFunction));
Assert.That(struc.var_9F, Is.EqualTo(3), nameof(struc.var_9F));
Assert.That(struc.AverageNumberOnMap, Is.EqualTo(3), nameof(struc.AverageNumberOnMap));
// ProducedQuantity
// ProducedCargoType
// RequiredCargoType
Expand Down Expand Up @@ -730,7 +730,7 @@ void assertFunc(ILocoObject obj, TrackObject struc) => Assert.Multiple(() =>
Assert.That(struc.SellCostFactor, Is.EqualTo(-10), nameof(struc.SellCostFactor));
// Signals
// Stations
Assert.That(struc.StationTrackPieces, Is.EqualTo(525), nameof(struc.StationTrackPieces));
Assert.That(struc.StationTrackPieces, Is.EqualTo(TrackObjectPieceFlags.Diagonal | TrackObjectPieceFlags.NormalCurve | TrackObjectPieceFlags.SmallCurve | TrackObjectPieceFlags.SBend), nameof(struc.StationTrackPieces));
Assert.That(struc.TrackPieces, Is.EqualTo(TrackObjectPieceFlags.Diagonal | TrackObjectPieceFlags.LargeCurve | TrackObjectPieceFlags.NormalCurve | TrackObjectPieceFlags.SmallCurve | TrackObjectPieceFlags.Slope | TrackObjectPieceFlags.SlopedCurve | TrackObjectPieceFlags.SBend | TrackObjectPieceFlags.Junction), nameof(struc.TrackPieces));
Assert.That(struc.TunnelCostFactor, Is.EqualTo(24), nameof(struc.TunnelCostFactor));
Assert.That(struc.var_06, Is.EqualTo(0), nameof(struc.var_06));
Expand All @@ -747,7 +747,7 @@ public void TrackExtraObject(string objectName)
{
void assertFunc(ILocoObject obj, TrackExtraObject struc) => Assert.Multiple(() =>
{
Assert.That(struc.TrackPieces, Is.EqualTo(1023), nameof(struc.TrackPieces));
Assert.That(struc.TrackPieces, Is.EqualTo(TrackObjectPieceFlags.Diagonal | TrackObjectPieceFlags.LargeCurve | TrackObjectPieceFlags.NormalCurve | TrackObjectPieceFlags.SmallCurve | TrackObjectPieceFlags.VerySmallCurve | TrackObjectPieceFlags.Slope | TrackObjectPieceFlags.SteepSlope | TrackObjectPieceFlags.OneSided | TrackObjectPieceFlags.SlopedCurve | TrackObjectPieceFlags.SBend), nameof(struc.TrackPieces));
Assert.That(struc.PaintStyle, Is.EqualTo(1), nameof(struc.PaintStyle));
Assert.That(struc.CostIndex, Is.EqualTo(1), nameof(struc.CostIndex));
Assert.That(struc.BuildCostFactor, Is.EqualTo(2), nameof(struc.BuildCostFactor));
Expand Down Expand Up @@ -797,7 +797,7 @@ void assertFunc(ILocoObject obj, TrainStationObject struc) => Assert.Multiple(()
Assert.That(struc.NumCompatible, Is.EqualTo(0), nameof(struc.NumCompatible));
Assert.That(struc.ObsoleteYear, Is.EqualTo(65535), nameof(struc.ObsoleteYear));
Assert.That(struc.SellCostFactor, Is.EqualTo(-7), nameof(struc.SellCostFactor));
Assert.That(struc.TrackPieces, Is.EqualTo(0), nameof(struc.TrackPieces));
Assert.That(struc.TrackPieces, Is.EqualTo(TrackObjectPieceFlags.None), nameof(struc.TrackPieces));
Assert.That(struc.var_0B, Is.EqualTo(2), nameof(struc.var_0B));
Assert.That(struc.var_0D, Is.EqualTo(0), nameof(struc.var_0D));
});
Expand Down

0 comments on commit 7da5af2

Please sign in to comment.