本文へ移動

Sugoroku双六

標準の規則、キューブ、試合の得点、シード付きのサイコロ、再生できる記録で、バックギャモンと仲間のゲームを遊べます。

「双六」は、盤と駒で遊ぶゲームの名前です。 名前について(英語)

目次

リファレンス · 盤面と局面の要素

SugorokuElementOptions型

リファレンスの説明と例は英語です。見出しと目次は日本語です。

Host mount options, including custom colours, names, a match and callbacks.

インポート

import type { SugorokuElementOptions } from "@johnmorrisdotca/sugoroku/element";

ほかのエクスポート元: @johnmorrisdotca/sugoroku/element/define

定義

type SugorokuElementOptions = SugorokuMountOptions;

メンバー

名前型説明
board (省略可)SugorokuBoardName | undefined
checkers (省略可)SugorokuCheckerSetName | undefined
colours (省略可)Partial<SugorokuColours> | undefined
theme (省略可)"auto" | "light" | "dark" | undefined
home (省略可)"left" | "right" | undefined

Which end of the board the trays are at.

view (省略可)Side | "auto" | undefined

Whose home board is at the bottom: auto (the default) is the side a person plays when the computer plays the other, otherwise white.

numbers (省略可)boolean | undefined

Numbers on the points.

orientation (省略可)Orientation | "auto" | undefined

auto (the default) stands the board up in a narrow page, such as a phone's.

variant (省略可)VariantKey | undefined

The variant. Default backgammon.

rules (省略可)Partial<Rules> | undefined

The rules left out are a single game with no cube.

preset (省略可)string | undefined

A named way of playing (a PRESETS key, such as backgammon-5) instead of variant and rules.

seed (省略可)RecordSeed | undefined

Dice from a seed, so the game can be played again; left out they are random.

dice (省略可)"button" | "host" | undefined

button (the default): a button rolls them. host: the page gives them, with roll, when sugoroku-need-dice says they are wanted.

computer (省略可){ 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 (省略可)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 (省略可)boolean | undefined

The buttons and the lines of words. Default true.

drag (省略可)boolean | undefined

Whether a checker may be dragged as well as tapped. Default true.

autoEnd (省略可)boolean | undefined

End a turn at once when it is played out, without waiting for Done. Default false.

language (省略可)SugorokuLanguage | undefined

The language the words are in. Left out, the host's own lang, or the page's, and it follows the page's.

names (省略可)Partial<Record<Side, string>> | undefined

What each side is called, instead of its colour or You and Computer.

sound (省略可)boolean | Partial<Record<SoundName, string>> | undefined

Sounds: true for the package's own, or the address of each. Default none.

match (省略可)Match | undefined

Carry on a match already begun.

onRoll (省略可)((detail: SugorokuEventDetail) => void) | undefined
onMove (省略可)((detail: SugorokuEventDetail) => void) | undefined
onTurn (省略可)((detail: SugorokuEventDetail) => void) | undefined
onCube (省略可)((detail: SugorokuEventDetail) => void) | undefined
onEnd (省略可)((detail: SugorokuEventDetail) => void) | undefined

例

import type { SugorokuElementOptions } from "@johnmorrisdotca/sugoroku/element";
const options: SugorokuElementOptions = {};
console.log(Object.keys(options).length); // 0
0

出力(このページを作ったときに実行した結果)

ソースを見るGitHub で編集@johnmorrisdotca/sugoroku 1.1.1 のソースから作成しました。

この日本語は、まだ日本語を母語とする方の確認を受けていません。訂正を歓迎します。