UNPKG

tsgammon-core

Version:

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

35 lines 1.52 kB
import { BGListener } from '../dispatchers/BGListener'; import { BGState } from '../dispatchers/BGState'; import { SingleGameListener } from '../dispatchers/SingleGameListener'; import { SGState } from '../dispatchers/SingleGameState'; import { GameConf } from '../GameConf'; import { MatchRecord } from './MatchRecord'; import { PlyRecordEoG, PlyRecordInPlay } from './PlyRecord'; import { PlyStateRecord } from './PlyStateRecord'; export declare type MatchRecorder<T> = { recordPly: (plyRecord: PlyRecordInPlay, lastState: T) => void; recordEoG: (plyRecord: PlyRecordEoG) => void; resetCurGame: () => void; resumeTo: (index: number) => PlyStateRecord<T>; }; /** * MatchRecorderをラップして、SingleGameListnerとして返す * @param matchRecorder ラップされるMatchRecorder * @returns */ export declare function matchRecorderAsSG(matchRecorder: MatchRecorder<SGState>): Partial<SingleGameListener>; /** * MatchRecorderをラップして、BGListnerとして返す * @param matchRecorder ラップされるMatchRecorder * @returns */ export declare function matchRecorderAsBG(gameConf: GameConf, matchRecorder: MatchRecorder<BGState>): Partial<BGListener>; /** * MatchRecorderオブジェクトを生成する * * @param matchRecord * @param setMatchRecord * @returns */ export declare function buildMatchRecorder<T>(matchRecord: MatchRecord<T>, setMatchRecord: (f: (prev: MatchRecord<T>) => MatchRecord<T>) => void): MatchRecorder<T>; //# sourceMappingURL=MatchRecorder.d.ts.map