UNPKG

tsgammon-core

Version:

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

22 lines 1.37 kB
import { DiceRoll } from '../Dices'; import { EOGStatus } from '../EOGStatus'; import { SGResult } from '../records/SGResult'; import { SingleGameListener } from './SingleGameListener'; import { SGInPlay, SGOpening, SGState, SGToRoll } from './SingleGameState'; /** * SingleGameについての操作を受け付け、結果に応じてListenerを呼ぶ。 * */ export declare type SingleGameDispatcher = { doStartGame: () => (listener: Pick<SingleGameListener, 'onGameStarted'>) => void; doOpeningRoll: (state: SGOpening, dices: DiceRoll) => (listener: Pick<SingleGameListener, 'onOpeningCheckerPlayStarted' | 'onRerollOpening'>) => void; doCommitCheckerPlay: (state: SGInPlay) => (listener: Pick<SingleGameListener, 'onEndOfGame' | 'onAwaitRoll' | 'onCheckerPlayCommitted'>) => void; doRoll: (state: SGToRoll, dices: DiceRoll) => (listener: Pick<SingleGameListener, 'onCheckerPlayStarted'>) => void; doEndOfGame: (state: SGState, result: SGResult, eogStatus: EOGStatus) => (listeners: Pick<SingleGameListener, 'onEndOfGame'>) => void; }; /** * SingleGameDispatcherオブジェクトを生成する */ export declare const singleGameDispatcher: SingleGameDispatcher; export declare function setSGStateListener(defaultSGState: SGState, setState: (state: SGState) => void): SingleGameListener; //# sourceMappingURL=SingleGameDispatcher.d.ts.map