Unify junction props

This commit is contained in:
2026-05-10 18:05:32 +02:00
parent 1aa9734e08
commit 9cd9defc0b
13 changed files with 70 additions and 84 deletions

View File

@@ -87,9 +87,9 @@ public sealed class SimulationEngineTests
}
[Fact]
public void TJunctionRatioSplitsFlowAcrossInferredOutgoingBranches()
public void JunctionRatioSplitsFlowAcrossInferredOutgoingBranches()
{
var level = BuildTJunctionLevel(ETJunctionMode.TwoTwo);
var level = BuildJunctionLevel(2);
var next = m_Engine.AdvanceTurn(level);
@@ -99,9 +99,9 @@ public sealed class SimulationEngineTests
}
[Fact]
public void TJunctionZeroWeightBranchReceivesNoIntentionalOutflow()
public void JunctionZeroWeightBranchReceivesNoIntentionalOutflow()
{
var level = BuildTJunctionLevel(ETJunctionMode.ZeroFour);
var level = BuildJunctionLevel(0);
var next = m_Engine.AdvanceTurn(level);
@@ -112,7 +112,7 @@ public sealed class SimulationEngineTests
[Fact]
public void ValidatorRejectsAmbiguousJunctionSourceBranches()
{
var level = BuildTJunctionLevel(ETJunctionMode.TwoTwo);
var level = BuildJunctionLevel(2);
level = level.SetProp(new(3, 3), new() { Type = EPropType.Flow, Carrier = ECarrierType.Fuel });
var report = new LevelValidator().Validate(level);
@@ -385,15 +385,15 @@ public sealed class SimulationEngineTests
return level;
}
private static LevelState BuildTJunctionLevel(ETJunctionMode mode)
private static LevelState BuildJunctionLevel(int mode)
{
var level = LevelState.Create("T junction", 6, 6);
var level = LevelState.Create("Junction", 6, 6);
level = level.SetUnderground(new(1, 3), ECarrierType.Fuel, new() { State = EUndergroundState.Intact });
level = level.SetUnderground(new(2, 3), ECarrierType.Fuel, new() { State = EUndergroundState.Intact });
level = level.SetUnderground(new(2, 2), ECarrierType.Fuel, new() { State = EUndergroundState.Intact });
level = level.SetUnderground(new(3, 3), ECarrierType.Fuel, new() { State = EUndergroundState.Intact });
level = level.SetProp(new(1, 3), new() { Type = EPropType.Flow, Carrier = ECarrierType.Fuel });
return level.SetProp(new(2, 3), new() { Type = EPropType.TJunction, Carrier = ECarrierType.Fuel, TJunctionMode = mode });
return level.SetProp(new(2, 3), new() { Type = EPropType.Junction, Carrier = ECarrierType.Fuel, JunctionMode = mode });
}
private static LevelState AddHorizontalUnderground(LevelState level, ECarrierType carrier, int startX, int endX, int y)
@@ -405,4 +405,4 @@ public sealed class SimulationEngineTests
}
private readonly SimulationEngine m_Engine = new();
}
}