UNPKG

backgammon

Version:

a clean api for building a backgammon game

31 lines (30 loc) 687 B
import { Point } from "./Point"; export declare enum PlayerColor { "black" = "black", "white" = "white" } export declare enum PlayerHome { white = 0, black = 25 } export declare enum PlayerPrison { white = 25, black = 0 } export declare class Player { home: Point; prison: Point; color: PlayerColor; constructor(color: PlayerColor); } export declare class Players { private white; private black; private _current; constructor(white: Player, black: Player, starter: Player); get current(): Player; get second(): Player; get White(): Player; get Black(): Player; toggle(): Player; }