Settings型
リファレンスの説明と例は英語です。見出しと目次は日本語です。
Validated settings fixed at native game creation.
インポート
import type { Settings } from "@johnmorrisdotca/houseki/gem-swap";
定義
interface Settings {
readonly width: number;
readonly height: number;
readonly colourCount: 4 | 5 | 6;
readonly seed: string | number;
readonly tools: boolean;
readonly advancedTools: boolean;
readonly shape?: BoardShape;
readonly mask: readonly boolean[];
}
メンバー
| 名前 | 型 | 説明 |
|---|---|---|
width | number | |
height | number | |
colourCount | 4 | 5 | 6 | |
seed | string | number | |
tools | boolean | |
advancedTools | boolean | |
shape (省略可) | BoardShape | undefined | |
mask | readonly boolean[] |
例
import { createGame } from "@johnmorrisdotca/houseki/gem-swap";
import type { Settings } from "@johnmorrisdotca/houseki/gem-swap";
const state=createGame({seed:"docs"});
const value: Settings = state.settings;
console.log(value == null ? value : typeof value === "object" ? Object.keys(value).slice(0,6) : value);[ 'width', 'height', 'colourCount', 'seed', 'tools', 'advancedTools' ]出力(このページを作ったときに実行した結果)
この日本語は、まだ日本語を母語とする方の確認を受けていません。訂正を歓迎します。