fix(world): restore portal and distant use lifecycles
This commit is contained in:
parent
c730632075
commit
1a14812c44
18 changed files with 401 additions and 196 deletions
|
|
@ -42,6 +42,32 @@ public sealed class LocalPlayerControllerSlotTests
|
|||
Assert.Same(controller.Motion, source.Motion);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void MotionPreparation_DrainsPriorAnimationBeforePublishingCandidate()
|
||||
{
|
||||
var slot = new LocalPlayerControllerSlot();
|
||||
ILocalPlayerMotionSource source = slot;
|
||||
var prior = new PlayerMovementController(new PhysicsEngine());
|
||||
var candidate = new PlayerMovementController(new PhysicsEngine());
|
||||
slot.Controller = prior;
|
||||
var order = new List<string>();
|
||||
|
||||
using (slot.BeginMotionPreparation(
|
||||
candidate,
|
||||
() =>
|
||||
{
|
||||
order.Add("drain");
|
||||
Assert.Same(prior.Motion, source.Motion);
|
||||
}))
|
||||
{
|
||||
order.Add("candidate");
|
||||
Assert.Same(candidate.Motion, source.Motion);
|
||||
}
|
||||
|
||||
Assert.Equal(["drain", "candidate"], order);
|
||||
Assert.Same(prior.Motion, source.Motion);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void MotionPreparation_RejectsConcurrentCandidate()
|
||||
{
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue