Files
SVSimServer/SVSim.BattleNode/Sessions/Engine/SessionBattleEngine.cs
gamer147 f6cbde723b feat(battlenode): SessionBattleEngine skeleton + types (Phase 2 N0)
SessionContentsCreator mirrors the test HeadlessContentsCreator fully (all
IBattleMgrContentsCreator members) so it compiles; Setup/Receive throw pending
the Task 3/4 probes. New files use the 'engine' extern alias.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-06 14:49:18 -04:00

29 lines
1.5 KiB
C#

extern alias engine;
using engine::SVSim.BattleEngine.Rng;
using SVSim.BattleNode.Protocol;
namespace SVSim.BattleNode.Sessions.Engine;
/// <summary>One authoritative engine per BattleSession, seated as both players (design ND2). A faithful
/// SHADOW: it mirrors each client's resolved play, never overrides/rejects/originates (ND1). Ingest is
/// the engine's own NetworkBattleReceiver.ReceivedMessage (ND4); isPlayer selects the seat (F-N-2).</summary>
internal sealed class SessionBattleEngine
{
private HeadlessNetworkBattleMgr? _mgr;
/// <summary>True once Setup has built the two-seat battle.</summary>
public bool IsReady => _mgr is not null;
/// <summary>Construct the two-seat network battle from both decks + the master seed (design F-N-5).
/// <paramref name="seatADeck"/>/<paramref name="seatBDeck"/> are the per-side deck orders the node
/// already computed (BattleSessionState.GetShuffledDeck) and handed each client.</summary>
public void Setup(int masterSeed,
IReadOnlyList<long> seatADeck, IReadOnlyList<long> seatBDeck)
=> throw new NotImplementedException("Filled by Task 3 (construction probe).");
/// <summary>Ingest one client frame into the engine for the given seat. <paramref name="isPlayerSeat"/>
/// maps the sender to the engine's player(true)/opponent(false) seat (F-N-2).</summary>
public EngineIngestResult Receive(MsgEnvelope env, bool isPlayerSeat)
=> throw new NotImplementedException("Filled by Task 4 (ingest probe).");
}