import { Card } from 'cardation'; import HandOutcome from './model/result/HandOutcome'; import ShoeOutcome from './model/result/ShoeOutcome'; import Config from './model/config/Config'; import Bet from './model/bet/Bet'; type BetPretreat = (prevBet: Bet | undefined, prevOutcome: HandOutcome | undefined) => Bet; type BetAftertreat = (hcome: HandOutcome) => void; type ShoePretreat = (card: Card | undefined) => void; /** * Synchronous engine. */ declare class Engine { private _punto; private _banco; private _totalGames; private _shoe; private _prevHandOutcome; private _prevBet; private _config; private _handIndex; private _recycleShoe; private _isExhausted; private _hasShutdown; private _hasShoeCustomised; get isShoeExhausted(): boolean; set isShoeExhausted(value: boolean); get isWorking(): boolean; /** * Shut down the engine. */ shutdown(): void; /** * Power on the engine with a config, or use the default config. * @param {Config} config */ powerOn(config?: Config): void; private _configEngine; /** * Initialize the shoe with 8 decks, or with a customized shoe. This method only be invoked once in the engine's life cycle. */ private initializeDecks; /** * Play one shoe. * @param {BetPretreat} beforeBet - (prevBet: Bet | undefined, prevOutcome: HandOutcome | undefined) => Bet * @param {BetAftertreat} afterBet - (hcome: HandOutcome) => void * @param {ShoePretreat} beforeShoe - (card: Card | undefined) => void * @return {ShoeOutcome} */ playOneShoe(beforeBet?: BetPretreat, afterBet?: BetAftertreat, beforeShoe?: ShoePretreat): ShoeOutcome; private _parseOutcome2BeadEntity; /** * 由收集箱放入 baccarat shoe */ private recycleCardToShoe; /** * Reset, shuffle, cut, detect, burn, insert black card. These actions must be done to start a new shoe. * @return {Card} The first card of the shoe. */ private prepareShoe; private resetGameIndex; /** * Insert a black card into the shoe by dealer. */ private insertBlackCard; playOneHand(): HandOutcome; private getRecycleShoe; /** * Draw a card for punto. */ private puntoDraw; /** * Draw a card for banco. */ private bancoDraw; private getShoe; private getPreviousHandOutcome; private getPunto; private getBanco; /** * Whether punto should draw a card. * @param {number} currentScore the current points of the punto hand * @return {boolean} whether punto should draw a card */ private shouldPuntoDraw; /** * Whether banco should draw a card. * @param {boolean} puntoHit did punto hit * @param {number} bancoPoint banco point * @param {number} puntoLastScore the point of the last card of punto * @return {boolean} whether banco should draw a card */ private shouldBancoDraw; /** * The game ID inside the shoe. * @return {number} the game index */ getGameIndex(): number; /** * Increase the game index by 1, and return the new game index. * @return {number} the new game index */ private increaseGameIndex; /** * The previous bet. * @return {Bet} the previous bet */ private getPreviousBet; } export default Engine;