/** * Base game state interface and implementation for all domains */ import { Identifiable, Serializable, Cloneable, Comparable, Hashable, PlayerId } from '../../types/common'; import { Action } from './action'; /** * Base interface that all game states must implement */ export interface GameState extends Identifiable, Serializable, Cloneable, Comparable, Hashable { /** Current player whose turn it is */ readonly currentPlayer: PlayerId; /** Whether this state represents a terminal/end state */ readonly isTerminal: boolean; /** Winner of the game (if terminal), undefined if draw or ongoing */ readonly winner: PlayerId | undefined; /** Score for the current player (optional, domain-specific) */ readonly score: number | undefined; /** Apply an action to this state and return the resulting state */ applyAction(action: Action): GameState; /** Get all valid actions from this state */ getValidActions(): Action[]; /** Get features for ML/evaluation purposes */ getFeatures(): number[]; /** Check if the game is a draw */ isDraw(): boolean; /** Get the current turn number */ getTurnNumber(): number; /** Get game-specific information */ getGameInfo(): Record; } /** * Abstract base implementation of GameState * Provides common functionality for all game states */ export declare abstract class BaseGameState implements GameState { readonly id: string; readonly currentPlayer: PlayerId; readonly isTerminal: boolean; readonly winner: PlayerId | undefined; readonly score: number | undefined; protected constructor(id: string, currentPlayer: PlayerId, isTerminal?: boolean, winner?: PlayerId | undefined, score?: number | undefined); abstract clone(): GameState; abstract applyAction(action: Action): GameState; abstract getValidActions(): Action[]; abstract serialize(): string; abstract getFeatures(): number[]; abstract getHashKey(): string; abstract getTurnNumber(): number; abstract getGameInfo(): Record; equals(other: GameState): boolean; isDraw(): boolean; toString(): string; /** * Utility method to generate a unique ID for a state */ protected static generateStateId(): string; /** * Utility method to switch to the next player */ protected getNextPlayer(playerCount?: number): PlayerId; /** * Utility method to check if a player has won */ protected checkWinner(): PlayerId | undefined; } //# sourceMappingURL=game-state.d.ts.map