import { Bitboard } from '../bitwise/types'; export declare enum DraughtsStatus { PLAYING = "playing", DRAW = "draw", LIGHT_WON = "light_won", DARK_WON = "dark_won" } export type DraughtsEngineBoard = { readonly light: TBitboard; readonly dark: TBitboard; readonly king: TBitboard; }; export type DraughtsEngineMove = { readonly origin: TBitboard; readonly destination: TBitboard; readonly captures: TBitboard; }; export declare enum DraughtsPlayer { LIGHT = "light", DARK = "dark" } export type DraughtsEngineData = { player: DraughtsPlayer; board: DraughtsEngineBoard; stats: { sinceCapture: number; sinceNonKingAdvance: number; }; }; export type DraughtsEngineStrategy = { moves: (engine: DraughtsEngine) => DraughtsEngineMove[]; status: (engine: DraughtsEngine) => DraughtsStatus; isValidMove: (engine: DraughtsEngine, move: DraughtsEngineMove) => boolean; move: (engine: DraughtsEngine, move: DraughtsEngineMove) => DraughtsEngineData; }; export declare class DraughtsEngine { data: DraughtsEngineData; private strategy; private _moves; private _status; constructor(data: DraughtsEngineData, strategy: DraughtsEngineStrategy); /** * Returns the current game status */ get status(): DraughtsStatus; /** * Returns the available moves */ get moves(): DraughtsEngineMove[]; /** * Clones the current engine instance * @returns A new cloned engine instance */ clone(): DraughtsEngine; /** * Serializes the engine data * @returns The serialized engine data */ serialize(): DraughtsEngineData; move(move: DraughtsEngineMove): void; isValidMove(move: DraughtsEngineMove): boolean; }