UNPKG

@idealic/poker-engine

Version:

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

26 lines 1.3 kB
import type { Action, Hand, Game } from '../types'; /** * @instructions * Button-SB-BB vs. seat indices: Don't hard-code that the BB always acts first postflop. Instead, figure out who the button is, then the first active seat to the left of the button. * Action order can change street by street: Preflop order often starts left of the BB; postflop starts left of the button. * Edge cases with short-handed tables: Heads-up is special; the SB is on the button. * All-in/fold skipping: Ensure you skip players who are all-in or folded. * Street transitions: When you move from one street to the next, track who should act first. * Detecting next player: Don't just "++index % numPlayers." * should NOT mutate data */ export declare function getCurrentPlayerIndex(game: Game): number; /** * Determines if action is a dealer action */ export declare function isDealerAction(action: Action): boolean; /** * Determines if action is a player action */ export declare function isPlayerAction(action?: Action, index?: number): boolean; export declare function applyAction(game: Game, action: Action): Game; /** * Determines if the game is in its initial state with no actions taken */ export declare function isGameJustStarted(hand: Hand): boolean; //# sourceMappingURL=processor.d.ts.map