refactor(G.3a): Place flips Idle before delegate; test mid-hold reset (#133)
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
parent
7947d7ad0a
commit
aca4b4645a
2 changed files with 27 additions and 1 deletions
|
|
@ -120,4 +120,28 @@ public class TeleportArrivalControllerTests
|
|||
Assert.Equal(2, placed.Count);
|
||||
Assert.Equal(0x01250127u, placed[1].Cell);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void BeginArrival_DuringHold_ResetsTimeoutCounter()
|
||||
{
|
||||
var placed = new List<PlaceCall>();
|
||||
var c = Make(ArrivalReadiness.NotReady, placed, maxHoldFrames: 3);
|
||||
|
||||
c.BeginArrival(new Vector3(1, 0, 0), 0x01250126u);
|
||||
c.Tick(); // held=1
|
||||
c.Tick(); // held=2 (one short of the timeout)
|
||||
|
||||
// Re-arm mid-hold with a fresh destination: the counter must restart.
|
||||
c.BeginArrival(new Vector3(2, 0, 0), 0x01250199u);
|
||||
c.Tick(); // held=1 again (NOT 3 -> no placement yet)
|
||||
c.Tick(); // held=2
|
||||
Assert.Empty(placed);
|
||||
Assert.Equal(TeleportArrivalPhase.Holding, c.Phase);
|
||||
|
||||
c.Tick(); // held=3 -> timeout, forced place of the SECOND destination
|
||||
var call = Assert.Single(placed);
|
||||
Assert.True(call.Forced);
|
||||
Assert.Equal(0x01250199u, call.Cell);
|
||||
Assert.Equal(new Vector3(2, 0, 0), call.Pos);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue