refactor(battlenode): name sender-only vs both-sides handshake checks (§D)

Behavior-preserving; 231 BattleNode tests green.

FrameDispatchContext.BothAfterReady() -> BothSidesAfterReady() (7 call sites). The
4 inline `SenderPhase == AfterReady` checks in TurnEndHandler/TurnEndFinalHandler now
read a new SenderIsAfterReady property. Both carry cross-referencing docs so the
Bot-arm (sender-only) vs PvP-arm (both-sides) distinction is explicit at the type.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
gamer147
2026-06-05 07:49:27 -04:00
parent 578d0a75ef
commit 9b8a7f1e37
10 changed files with 24 additions and 17 deletions

View File

@@ -26,9 +26,16 @@ internal sealed class FrameDispatchContext
set { if (From is IHasHandshakePhase p && value is { } v) p.Phase = v; }
}
/// <summary>Both participants have completed the handshake. Reads A/B (not From/Other) so the
/// result is identical regardless of which side sent the frame — matches legacy BothAfterReady.</summary>
internal bool BothAfterReady() =>
/// <summary>Just the SENDER has finished the handshake — says nothing about the opponent. The
/// Bot arms gate on this (the bot has no handshake phase of its own); contrast
/// <see cref="BothSidesAfterReady"/>, which the PvP arms require. The sender-only vs both-sides
/// distinction is load-bearing for the Bot/PvP split (see TurnEndHandler / TurnEndFinalHandler).</summary>
internal bool SenderIsAfterReady => SenderPhase == HandshakePhase.AfterReady;
/// <summary>BOTH participants have finished the handshake. Reads A/B (not From/Other) so the
/// result is identical regardless of which side sent the frame. Contrast
/// <see cref="SenderIsAfterReady"/> (sender only).</summary>
internal bool BothSidesAfterReady() =>
(A as IHasHandshakePhase)?.Phase == HandshakePhase.AfterReady &&
(B as IHasHandshakePhase)?.Phase == HandshakePhase.AfterReady;
}