SugorokuMountOptionstype
Native variant, rules, seed, computer, display, control, sound and event-callback choices.
Import it
import type { SugorokuMountOptions } from "@johnmorrisdotca/sugoroku/play";
Definition
type SugorokuMountOptions = SugorokuLook & {
variant?: VariantKey;
rules?: Partial<Rules>;
preset?: string;
seed?: RecordSeed;
dice?: "button" | "host";
computer?: {
white?: Strength | null;
black?: Strength | null;
};
computerDelay?: number;
controls?: boolean;
drag?: boolean;
autoEnd?: boolean;
language?: SugorokuLanguage;
names?: Partial<Record<Side, string>>;
sound?: boolean | SoundUrls;
match?: Match;
onRoll?: (detail: SugorokuEventDetail) => void;
onMove?: (detail: SugorokuEventDetail) => void;
onTurn?: (detail: SugorokuEventDetail) => void;
onCube?: (detail: SugorokuEventDetail) => void;
onEnd?: (detail: SugorokuEventDetail) => void;
};
Members
| Name | Type | Description |
|---|---|---|
board (optional) | SugorokuBoardName | undefined | |
checkers (optional) | SugorokuCheckerSetName | undefined | |
colours (optional) | Partial<SugorokuColours> | undefined | |
theme (optional) | "auto" | "light" | "dark" | undefined | |
home (optional) | "left" | "right" | undefined | Which end of the board the trays are at. |
view (optional) | Side | "auto" | undefined | Whose home board is at the bottom: |
numbers (optional) | boolean | undefined | Numbers on the points. |
orientation (optional) | Orientation | "auto" | undefined |
|
variant (optional) | VariantKey | undefined | The variant. Default |
rules (optional) | Partial<Rules> | undefined | The rules left out are a single game with no cube. |
preset (optional) | string | undefined | A named way of playing (a |
seed (optional) | RecordSeed | undefined | Dice from a seed, so the game can be played again; left out they are random. |
dice (optional) | "button" | "host" | undefined |
|
computer (optional) | { white?: Strength | null; black?: Strength | null; } | undefined | The strength of the computer for each side it plays. A side left out, or null, is played by a person. |
computerDelay (optional) | number | undefined | How long the computer pauses between what it does, in milliseconds. Default 450, and none for a reader who has asked for less motion. |
controls (optional) | boolean | undefined | The buttons and the lines of words. Default true. |
drag (optional) | boolean | undefined | Whether a checker may be dragged as well as tapped. Default true. |
autoEnd (optional) | boolean | undefined | End a turn at once when it is played out, without waiting for Done. Default false. |
language (optional) | SugorokuLanguage | undefined | The language the words are in. Left out, the host's own |
names (optional) | Partial<Record<Side, string>> | undefined | What each side is called, instead of its colour or |
sound (optional) | boolean | Partial<Record<SoundName, string>> | undefined | Sounds: |
match (optional) | Match | undefined | Carry on a match already begun. |
onRoll (optional) | ((detail: SugorokuEventDetail) => void) | undefined | |
onMove (optional) | ((detail: SugorokuEventDetail) => void) | undefined | |
onTurn (optional) | ((detail: SugorokuEventDetail) => void) | undefined | |
onCube (optional) | ((detail: SugorokuEventDetail) => void) | undefined | |
onEnd (optional) | ((detail: SugorokuEventDetail) => void) | undefined |
Examples
import type { SugorokuMountOptions } from "@johnmorrisdotca/sugoroku/play";
const value: SugorokuMountOptions = {variant:"backgammon",seed:42,computer:{black:"greedy"}};
console.log(value);{ variant: 'backgammon', seed: 42, computer: { black: 'greedy' } }What it prints (run when this page was built)