chess-easy
Version:
Chess engine that makes writing chessgame easier than writing a calculator
24 lines (23 loc) • 966 B
TypeScript
import { Colors } from "../types/common";
import { GameState, PromotionPossibility } from "../types/game";
import { MoveIndexes } from "./MoveIndexes";
export declare class MoveMaker {
gameState: GameState;
enPassantPossibility: string;
movesNext: Colors;
castlingAvailability: string;
constructor(gameState: GameState, enPassantPossibility: string, movesNext: Colors, castlingAvailability: string);
private handleEnPassantCapture;
private handleCastling;
static isPromotionMove(gameState: GameState, moveIndexes: MoveIndexes, movesNext: Colors): boolean;
private getNewPiece;
private removeCastlingFromColor;
private revalidateCastlingAvailability;
private removeCastilngIfRookStateChange;
private handleEnPassantPossibility;
move(from: string, to: string, promotion?: PromotionPossibility): {
gameState: GameState;
enPassantPossibility: string;
castlingAvailability: string;
};
}