Align frontend pulse contract and tasks

This commit is contained in:
2026-05-14 10:26:56 +02:00
parent 830c7aef14
commit 6decf2a9d2
13 changed files with 129 additions and 90 deletions

View File

@@ -67,7 +67,7 @@ public sealed class SimulationEngineTests
var next = m_Engine.MoveRobot(level, new(2, 1));
Assert.Equal(new(2, 1), next.Robot.Position);
Assert.Equal(0, next.Global.Turn);
Assert.Equal(0, next.Global.Pulse);
}
[Fact]
@@ -434,6 +434,21 @@ public sealed class SimulationEngineTests
Assert.Equal(new(6, 3), loaded.Leaks[0].AccessPosition);
}
[Fact]
public void LevelSerializationRoundTripsValveAndSprinklerFields()
{
var level = SprinklerLevel(EPropSwitchState.Disabled);
level = level.SetUnderground(new(3, 3), ECarrierType.Fuel, new() { State = EUndergroundState.Intact });
level = level.SetProp(new(3, 3), new() { Type = EPropType.IsolationValve, Carrier = ECarrierType.Fuel, SwitchState = EPropSwitchState.Disabled });
var loaded = LevelSerializer.Deserialize(LevelSerializer.Serialize(level));
Assert.Equal(EPropType.IsolationValve, loaded.GetProp(new(3, 3)).Type);
Assert.Equal(EPropSwitchState.Disabled, loaded.GetProp(new(3, 3)).SwitchState);
Assert.Equal(new(2, 1), loaded.GetProp(new(3, 2)).LinkedPosition);
Assert.Equal(new(2, 2), loaded.GetProp(new(2, 1)).OutletPosition);
}
[Fact]
public void LevelSerializationRejectsOldSchema()
{