/** * Chess-specific GameState implementation */ import { BaseGameState } from "../base/game-state"; import { ChessAction, Color, Square, ChessPiece } from "./chess-action"; /** * Chess board representation */ export type ChessBoard = (ChessPiece | null)[][]; /** * Chess game status */ export declare enum GameStatus { ACTIVE = "active", CHECK = "check", CHECKMATE = "checkmate", STALEMATE = "stalemate", DRAW_THREEFOLD = "draw_threefold", DRAW_FIFTY_MOVE = "draw_fifty_move", DRAW_INSUFFICIENT = "draw_insufficient", DRAW_AGREEMENT = "draw_agreement" } /** * Castling rights */ export interface CastlingRights { whiteKingside: boolean; whiteQueenside: boolean; blackKingside: boolean; blackQueenside: boolean; } /** * Chess-specific game state */ export declare class ChessState extends BaseGameState { private board; private castlingRights; private enPassantTarget; private halfmoveClock; private fullmoveNumber; private gameStatus; private moveHistory; private positionHistory; constructor(id?: string, board?: ChessBoard, currentPlayer?: Color, castlingRights?: CastlingRights, enPassantTarget?: Square | null, halfmoveClock?: number, fullmoveNumber?: number); /** * Get the chess board */ getBoard(): ChessBoard; /** * Get piece at a specific square */ getPieceAt(square: Square): ChessPiece | null; /** * Get all pieces of a specific color */ getPiecesOfColor(color: Color): ChessPiece[]; /** * Find the king of a specific color */ findKing(color: Color): ChessPiece | null; /** * Check if a square is under attack by the specified color */ isSquareAttackedBy(square: Square, attackingColor: Color): boolean; /** * Check if the current player is in check */ isInCheck(color?: Color): boolean; /** * Get all legal actions for the current player */ getAvailableActions(): ChessAction[]; /** * Apply an action to create a new state */ applyAction(action: ChessAction): ChessState; /** * Check if an action is valid in this state */ isActionValid(action: ChessAction): boolean; /** * Get the current game status */ getGameStatus(): GameStatus; /** * Check if the game is terminal */ isGameTerminal(): boolean; /** * Get turn number */ getTurnNumber(): number; /** * Get valid actions (required by BaseGameState) */ getValidActions(): ChessAction[]; /** * Get features for ML (required by BaseGameState) */ getFeatures(): number[]; /** * Get hash key (required by BaseGameState) */ getHashKey(): string; /** * Get game info (required by BaseGameState) */ getGameInfo(): Record; /** * Serialize the state */ serialize(): string; /** * Clone the state */ clone(): ChessState; /** * Get FEN (Forsyth-Edwards Notation) representation */ getFEN(): string; /** * Get material balance */ getMaterialBalance(): number; private createInitialBoard; private squareToIndices; private indicesToSquare; private canPieceAttackSquare; private getLegalMovesForPiece; private executeMoveOnBoard; private updateCastlingRights; private createTestState; private updateGameStatus; private isThreefoldRepetition; private getFENPosition; private getFENCastling; private piecesEqual; protected static generateStateId(): string; } //# sourceMappingURL=chess-state.d.ts.map