cloakfall
    Preparing search index...

    Interface GameSession

    Everything one game needs that used to live in a handful of module-level singletons: the lobby settings, the attack lock, the timed queue every action runs on, and the in-progress placement phase, if any. One of these exists per game, keyed by that game's own document root - see getSession.

    interface GameSession {
        attackLock: { isLocked: boolean };
        generation: number;
        hints: HintSetting;
        mode: GameMode;
        onAttackerChanged: ((attacker: Player, root: DomItemRoot) => void) | null;
        onGameOver: ((players: Player[], parent: DomItemRoot) => void) | null;
        placement: PlacementSession | null;
        queue: (fn: Function, time?: number, ...args: any[]) => Promise<any>;
        settings: GameSettings;
        turnTimer: boolean;
    }
    Index
    attackLock: { isLocked: boolean }
    generation: number

    Which game on this root the queue is running steps for: stopGame bumps it, and a step queued for an earlier one is skipped when its turn comes (see queue.ts), so a game that was quit or restarted can't keep playing.

    mode: GameMode
    onAttackerChanged: ((attacker: Player, root: DomItemRoot) => void) | null

    Called whenever a human player becomes the attacker - see updatePlayer.ts, the one place a player's own attacker flag actually flips. null (the default) for local hot-seat, which has no need for a per-turn timer (one shared screen, nobody to stall). Set by a remote room's game (see gameplay.ts's startRoomGame) to start/reset that player's own turn-timeout deadline.

    onGameOver: ((players: Player[], parent: DomItemRoot) => void) | null

    Overrides how endGame.ts shows the final score, for a remote room's game - see gameplay.ts's startRoomGame. null (the default) keeps local hot-seat's own finalScore screen and its Play Again/Change Settings/Main Menu buttons, which only make sense for one physical screen controlling the whole game.

    placement: PlacementSession | null
    queue: (fn: Function, time?: number, ...args: any[]) => Promise<any>
    settings: GameSettings
    turnTimer: boolean

    Local games: whether a human's turn has a time limit, after which a random shot is fired for them (the game menu's "Turn timer", setup/localTurnTimer.ts). Kept for the next games on the same page.