namespace SVSim.BattleNode.Sessions;
public interface IBattleSessionStore
{
/// Register a battle minted by the matching bridge, awaiting a WS connect.
/// Returns false if a battle with the same id is already pending (caller should retry
/// with a fresh id).
bool TryRegisterPending(PendingBattle battle);
/// Look up the pending battle. Returns null if not present.
PendingBattle? TryGetPending(string battleId);
///
/// Find a pending battle this viewer is a participant in (P1 or P2). Used by the
/// HTTP-side /ai_<fmt>/start endpoint to retrieve the deck/cosmetic
/// context the viewer registered at do_matching time — the /start
/// request body carries no deck_no of its own. Returns null if the viewer
/// has no pending battle (already consumed by WS connect, never registered, or
/// evicted by timeout).
///
PendingBattle? TryFindPendingForViewer(long viewerId);
/// Mark a battle as no longer pending (e.g. on successful connect or explicit close).
bool RemovePending(string battleId);
}