Settings型
リファレンスの説明と例は英語です。見出しと目次は日本語です。
The settings of a game: the variant's row and the rules. What every game and match is made from.
インポート
import type { Settings } from "@johnmorrisdotca/sugoroku";
定義
type Settings = {
variant: VariantSpec;
rules: Rules;
};
メンバー
| 名前 | 型 | 説明 |
|---|---|---|
variant | VariantSpec | |
rules | Rules |
例
import { settingsFor } from "@johnmorrisdotca/sugoroku";
import type { Settings } from "@johnmorrisdotca/sugoroku";
const settings = settingsFor("backgammon",{points:5,cube:true});
const value: Settings = settings;
console.log(value);{
variant: {
checkers: 15,
dice: 2,
doubles: 'four',
direction: 'opposed',
opening: 'roll-off',
goal: 'first-off',
holdBelow: 0,
drawAfter: 0,
key: 'backgammon',
layout: [ [Array], [Array], [Array], [Array] ]
},
rules: {
points: 5,
cube: true,
crawford: true,
jacoby: false,
beaver: false,
gammons: false
}
}出力(このページを作ったときに実行した結果)
この日本語は、まだ日本語を母語とする方の確認を受けていません。訂正を歓迎します。