import { IGameConfig, INextDirection, IPlayerContext, IPlayerContextValue, IPlayTarget, IRoundPlayConditions } from '../types/game-config'; import { Deck } from './deck'; import { IResolveConditional } from '../types/conditional'; export interface INewGameOptions { config: IGameConfig; playerIds: Array; } export interface IGameOptions { options: IGameState; } export interface IGameState { config: IGameConfig; playerIds: Array; points: Array; rounds: Array; currentRoundIdx: number; complete: boolean; winner?: number; } export interface IGamePlayer { hand: Array; played: Array>; collected: Array>; skipped: boolean; points: number; callCount: number; called: Array>; context: Record; } export interface IGameRound { deck: Deck; dealerIdx: number; turnIdx: number; subRoundIdx: number; players: Array; table: Array; discards: Array; firstPlayerIdx: number; previousPlayerIdx: number[]; currentPlayerIdx: number; winner?: number; called: Array; subRounds: Array; } export declare class Game { private config; private playerIdsInternal; private points; private rounds; private currentRoundIdx; private complete; private gameWinner; /** * The game winner player id * * @readonly * @memberof Game */ get winner(): string | undefined; /** * The round winner player id * * @readonly * @memberof Game */ getRoundWinner(roundIdx: number): string | undefined; get isActive(): boolean; get currentPlayerId(): string; get currentPlayerIdx(): number; get currentDealerIdx(): number; private get playerIds(); private get currentRealRound(); private get previousRealRound(); private get currentRound(); private get previousRound(); private get currentPlayer(); private get roundPlayConditions(); private get subRoundPlayConditions(); get currentPlayConditions(): IRoundPlayConditions; get currentPlayerData(): IGamePlayer; get useSubRounds(): boolean; get roundComplete(): any; get subRoundComplete(): any; get gameComplete(): any; private previousPlayerIdx; get previousPlayedCards(): Array; asJSON(): IGameState; constructor(options: INewGameOptions | IGameOptions); private getDataProxy; private parseDataValue; private createDataProxy; private resolveCheck; resolveCheckCurrentUser: (conditional: IResolveConditional, other?: any) => any; private evaluateUserIdx; private getRoundConfig; private getSubRoundConfig; private getNextPlayer; private removeCardsFromHand; private addCardsToHand; private setContextFlags; private setContextFlag; private newRound; private newSubRound; private evaluateWinner; private evaluateRoundWinner; private evaluateSubRoundWinner; private calculateRoundPoints; private calculateGamePoints; get roundWon(): boolean; get canAddPlayer(): boolean; addPlayer: (playerId: string) => void; get canStart(): boolean; start: () => "passCards" | "start"; private canDo; get passDirection(): INextDirection; get canPass(): boolean; pass: (playerIdx: number, cards: Array) => void; deal: () => { players: string[][]; table: string[]; }; get canDraw(): any; get drawTargets(): ("deck" | "discard")[]; draw: (fromDiscard: boolean) => void; get canSkip(): any; skip: () => void; get canPlay(): any; checkAllowedPlay: (cards: Array, target: IPlayTarget, otherPlayerIdx?: number | undefined) => any; /** * !WARNING! This method skips guard checks only use if you are know that it will not break the game * @param cards * @param target * @param otherPlayerIdx */ directPlay: (cards: Array, target?: IPlayTarget, otherPlayerIdx?: number | undefined) => void; play: (cards: Array, target?: IPlayTarget, otherPlayerIdx?: number | undefined) => void; get canCall(): any; call: (playerIdx: number) => void; get canDiscard(): any; discard: (cards: Array) => void; get canPlace(): any; place: (cards: Array) => void; done: () => void; setPlayerContextFlag: (flag: string, value: IPlayerContextValue, playerIdx?: number | undefined) => void; setPlayerContextFlags: (context: IPlayerContext, playerIdx?: number | undefined) => void; } //# sourceMappingURL=game.d.ts.map