UNPKG

@vlad-yakovlev/poker

Version:
36 lines (35 loc) 958 B
import { PlayerData } from '../types/state.js'; import { Combination } from './Combination.js'; import { Room } from './Room.js'; export type PlayerParams = { id: string; room: Room; }; export declare class Player<Payload = any> { room: Room; id: string; cards: number[]; balance: number; betAmount: number; hasFolded: boolean; hasLost: boolean; hasTurned: boolean; payload: Payload; constructor(room: Room, playerData: PlayerData<Payload>); /** * Best combination built from player and room cards */ get bestCombination(): Combination | undefined; /** * Amount that player should pay to call */ get callAmount(): number; get minRaiseAmount(): number; get maxRaiseAmount(): number; get canFold(): boolean; get canCheck(): boolean; get canCall(): boolean; get canRaise(): boolean; get canAllIn(): boolean; increaseBet(amount: number): void; }