UNPKG

@nodots-llc/backgammon-ai

Version:

AI and integration for nodots-backgammon using the @nodots-llc/gnubg-hints native addon.

21 lines 1.3 kB
import type { BackgammonBoard, BackgammonCheckerContainer, BackgammonColor, BackgammonGame, BackgammonPlayMoving } from '@nodots-llc/backgammon-types'; import type { GameHintContextOverrides, HintRequest } from '@nodots-llc/gnubg-hints'; export type GnubgColor = Exclude<BackgammonColor, undefined>; export interface GnubgColorNormalization { toGnu: Record<GnubgColor, GnubgColor>; fromGnu: Record<GnubgColor, GnubgColor>; } export interface PlayHintContext { request: HintRequest; normalization: GnubgColorNormalization; } export interface GameHintContext { request: HintRequest; normalization: GnubgColorNormalization; } export declare function normalizeBoardForHints(board: BackgammonBoard, colorMap: Record<GnubgColor, GnubgColor>): BackgammonBoard; export declare function buildHintContextFromPlay(play: BackgammonPlayMoving): PlayHintContext; export declare function buildHintContextFromGame(game: BackgammonGame, overrides?: GameHintContextOverrides): GameHintContext; export declare function getNormalizedPosition(container: BackgammonCheckerContainer | undefined, normalizedColor: GnubgColor): number | null; export declare function getContainerKind(container: BackgammonCheckerContainer | undefined): 'point' | 'bar' | 'off'; //# sourceMappingURL=hintContext.d.ts.map