Settings型
リファレンスの説明と例は英語です。見出しと目次は日本語です。
Validated settings fixed at native game creation.
インポート
import type { Settings } from "@johnmorrisdotca/houseki/falling-triplets";
定義
interface Settings {
readonly mode: Mode;
readonly width: number;
readonly height: number;
readonly colourCount: 4 | 5 | 6;
readonly seed: string;
readonly pieceLimit?: number;
readonly goal?: 'targets' | 'chain' | 'empty';
readonly targetIds?: readonly number[];
readonly minimumChain?: number;
readonly challengeBoard?: readonly (Gem | null)[];
readonly challengeQueue?: readonly Triplet[];
readonly witness?: readonly ChallengeHint[];
}
メンバー
| 名前 | 型 | 説明 |
|---|---|---|
mode | Mode | |
width | number | |
height | number | |
colourCount | 4 | 5 | 6 | |
seed | string | |
pieceLimit (省略可) | number | undefined | |
goal (省略可) | "targets" | "chain" | "empty" | undefined | |
targetIds (省略可) | readonly number[] | undefined | |
minimumChain (省略可) | number | undefined | |
challengeBoard (省略可) | readonly (Gem | null)[] | undefined | |
challengeQueue (省略可) | readonly Triplet[] | undefined | |
witness (省略可) | readonly ChallengeHint[] | undefined |
例
import { createGame } from "@johnmorrisdotca/houseki/falling-triplets";
import type { Settings } from "@johnmorrisdotca/houseki/falling-triplets";
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);[ 'mode', 'width', 'height', 'colourCount', 'seed' ]出力(このページを作ったときに実行した結果)
この日本語は、まだ日本語を母語とする方の確認を受けていません。訂正を歓迎します。