UNPKG

@idealic/poker-engine

Version:

Professional poker game engine and hand evaluator with built-in iterator utilities

23 lines 934 B
import type { Game, CommandName } from '../types'; /** * Unified validation function for all game commands. * This is a catch-all method that validates whether a specific command can be executed * in the current game state. * * @param game - The current game state * @param command - The command name to validate * @param args - Additional arguments required by specific commands * @returns true if the command is valid and can be executed, false otherwise * * @example * // Check if player 0 can fold * const canPlayerFold = Poker.Game.can(game, 'fold', 0); * * // Check if player 1 can bet 100 chips * const canPlayerBet = Poker.Game.can(game, 'bet', 1, 100); * * // Check if dealer can deal board cards * const canDealBoard = Poker.Game.can(game, 'dealBoard', ['Ah', 'Kh', 'Qh']); */ export declare function can(game: Game, command: CommandName, ...args: any[]): boolean; //# sourceMappingURL=validation.d.ts.map