UNPKG

xcore-casino

Version:

Casino Core module

69 lines 2.59 kB
import { WasmResponse } from '../../core/types/base'; import { BaccaratHands, BaccaratInfo, BaccaratRoadmaps, DrawPossibilities, IBaccaratGame, ResultInfo } from './types'; export interface BaccaratModule { rankHand(hands: Uint8Array): Uint8Array; unrankHand(index: Uint8Array): Uint8Array; canDraw(hands: Uint8Array): Uint8Array; determineResult(hands: Uint8Array): Uint8Array; idxToResultInfo(index: Uint8Array): Uint8Array; resultInfoToIdx(info: Uint8Array): Uint8Array; roadmaps: (results: Uint8Array) => Uint8Array; info(): Uint8Array; } export declare class BaccaratGame implements IBaccaratGame { private readonly logger; /** * Get the appropriate baccarat module from the WASM instance * Handles both nested structure (casino.baccarat) and direct structure (baccarat) */ private getBaccaratModule; /** * Rank a baccarat hand * @param hands The baccarat hands to rank * @returns Promise with the rank number */ rankHand(hands: BaccaratHands): Promise<WasmResponse<number>>; /** * Convert index to hand * @param index The index to convert * @returns Promise with the baccarat hands */ unrankHand(index: number): Promise<WasmResponse<BaccaratHands>>; /** * Check if player or banker can draw * @param hands The current hands * @returns Promise with draw possibilities for player and banker */ canDraw(hands: BaccaratHands): Promise<WasmResponse<DrawPossibilities>>; /** * Determine the result of a hand * @param hands The hands to evaluate * @returns Promise with the result number */ determineResult(hands: BaccaratHands): Promise<WasmResponse<number>>; /** * Convert index to result info * @param index The index to convert * @returns Promise with the result information */ idxToResultInfo(index: number): Promise<WasmResponse<ResultInfo>>; /** * Convert result info to index * @param info The result info * @returns Promise with the index number */ resultInfoToIdx(info: ResultInfo): Promise<WasmResponse<number>>; /** * Get baccarat information * @returns Promise with baccarat information */ info(): Promise<WasmResponse<BaccaratInfo>>; /** * Generate roadmaps for Baccarat game results * @param results Array of game results * @returns Promise with the roadmaps data */ roadmaps(results: number[]): Promise<WasmResponse<BaccaratRoadmaps>>; private wrapWasmCall; } //# sourceMappingURL=game.d.ts.map