feat(core/slice-1): TeleportAnimSequencer — Begin(), IsActive, enter-sound edge event
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
parent
4f7e8ec30a
commit
0468df21f5
2 changed files with 189 additions and 0 deletions
|
|
@ -40,4 +40,32 @@ public sealed class TeleportAnimSequencerTests
|
|||
Assert.False(snap.ShowTunnel);
|
||||
Assert.False(snap.ShowPleaseWait);
|
||||
}
|
||||
|
||||
// --- Task 1.2: Begin(), IsActive, initial state ---
|
||||
|
||||
[Theory]
|
||||
[InlineData(TeleportEntryKind.Portal, TeleportAnimState.Tunnel)]
|
||||
[InlineData(TeleportEntryKind.Login, TeleportAnimState.Tunnel)]
|
||||
[InlineData(TeleportEntryKind.Death, TeleportAnimState.Tunnel)]
|
||||
[InlineData(TeleportEntryKind.Logout, TeleportAnimState.WorldFadeOut)]
|
||||
public void Begin_SetsCorrectStartState(TeleportEntryKind kind, TeleportAnimState expectedStart)
|
||||
{
|
||||
var seq = new TeleportAnimSequencer();
|
||||
Assert.False(seq.IsActive);
|
||||
|
||||
seq.Begin(kind);
|
||||
|
||||
Assert.True(seq.IsActive);
|
||||
Assert.Equal(expectedStart, seq.State);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void Begin_EmitsPlayEnterSoundOnFirstTick()
|
||||
{
|
||||
// PlayEnterSound is edge-triggered on the first Tick after Begin.
|
||||
var seq = new TeleportAnimSequencer();
|
||||
seq.Begin(TeleportEntryKind.Portal);
|
||||
var (_, events) = seq.Tick(dt: 0f, worldReady: false);
|
||||
Assert.Contains(TeleportAnimEvent.PlayEnterSound, events);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue