UNPKG

tsgammon-core

Version:

A Backgammon library for Typescript, formerly developed as a part of tsgammon-ui

49 lines 1.63 kB
import { CubeState } from '../../CubeState'; import { DicePip } from '../../Dices'; import { GameConf } from '../../GameConf'; import { Ply } from '../../Ply'; import { Score } from '../../Score'; import { CBState } from '../CubeGameState'; import { SGState } from '../SingleGameState'; export declare enum GameStatus { OPENING = 0, INPLAY_RED = 1, INPLAY_WHITE = 2, CUBEACTION_RED = 3, CUBEACTION_WHITE = 4, CUBERESP_RED = 5, CUBERESP_WHITE = 6, TOROLL_RED = 7, TOROLL_WHITE = 8, EOG_REDWON = 9, EOG_WHITEWON = 10 } /** * ゲーム中の一局面を表すオブジェクトを構成するためのパラメーターの定義:局面に応じて、必要な項目は変化する */ export declare type GameSetup = { gameStatus?: GameStatus.OPENING; absPos?: number[]; cubeState?: CubeState; } | { gameStatus: GameStatus.TOROLL_RED | GameStatus.TOROLL_WHITE | GameStatus.CUBEACTION_RED | GameStatus.CUBEACTION_WHITE | GameStatus.CUBERESP_RED | GameStatus.CUBERESP_WHITE; absPos: number[]; cubeState?: CubeState; lastPly?: Ply; } | { gameStatus: GameStatus.EOG_REDWON | GameStatus.EOG_WHITEWON; absPos: number[]; stake: Score; cubeState?: CubeState; lastPly?: Ply; } | { gameStatus: GameStatus.INPLAY_RED | GameStatus.INPLAY_WHITE; dice1: DicePip; dice2: DicePip; absPos: number[]; cubeState?: CubeState; lastPly?: Ply; }; export declare function toCBState(gameState?: GameSetup): CBState; export declare function toSGState(gameState?: GameSetup, gameConf?: GameConf): SGState; //# sourceMappingURL=GameSetup.d.ts.map