Settings型
リファレンスの説明と例は英語です。見出しと目次は日本語です。
Run settings fixed at game creation.
インポート
import type { Settings } from "@johnmorrisdotca/houseki/colour-chains";
定義
interface Settings {
readonly mode: Mode;
readonly width: number;
readonly height: number;
readonly colourCount: 4 | 5 | 6;
readonly seed: string;
readonly date?: string;
readonly pairLimit?: number;
readonly nature?: true;
readonly weather?: WeatherSchedule;
readonly challengeId?: string;
readonly goal?: ChallengeGoal;
readonly initialBoard?: readonly (ChallengeGem | null)[];
readonly queue?: readonly (readonly [
Colour,
Colour
])[];
readonly magneticQueue?: readonly (readonly [
boolean,
boolean
])[];
readonly witness?: readonly WitnessStep[];
}
メンバー
| 名前 | 型 | 説明 |
|---|---|---|
mode | Mode | |
width | number | |
height | number | |
colourCount | 4 | 5 | 6 | |
seed | string | |
date (省略可) | string | undefined | |
pairLimit (省略可) | number | undefined | |
nature (省略可) | true | undefined | |
weather (省略可) | WeatherSchedule | undefined | |
challengeId (省略可) | string | undefined | |
goal (省略可) | ChallengeGoal | undefined | |
initialBoard (省略可) | readonly (Gem | null)[] | undefined | |
queue (省略可) | readonly (readonly [Colour, Colour])[] | undefined | |
magneticQueue (省略可) | readonly (readonly [boolean, boolean])[] | undefined | |
witness (省略可) | readonly WitnessStep[] | undefined |
例
import { createGame } from "@johnmorrisdotca/houseki/colour-chains";
import type { Settings } from "@johnmorrisdotca/houseki/colour-chains";
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' ]出力(このページを作ったときに実行した結果)
この日本語は、まだ日本語を母語とする方の確認を受けていません。訂正を歓迎します。