Settingstype
Validated settings fixed at native game creation.
Import it
import type { Settings } from "@johnmorrisdotca/houseki/stone-collapse";
Definition
interface Settings {
readonly mode: GameMode;
readonly width: number;
readonly height: number;
readonly colourCount: 4 | 5 | 6;
readonly seed: string | number;
readonly shape?: BoardShape;
readonly mask: readonly boolean[];
readonly dailyDate?: string;
readonly challengeId?: string;
readonly goal?: ChallengeGoal;
readonly moveLimit?: number;
readonly tools: boolean;
}
Members
| Name | Type | Description |
|---|---|---|
mode | GameMode | |
width | number | |
height | number | |
colourCount | 4 | 5 | 6 | |
seed | string | number | |
shape (optional) | BoardShape | undefined | |
mask | readonly boolean[] | |
dailyDate (optional) | string | undefined | |
challengeId (optional) | string | undefined | |
goal (optional) | ChallengeGoal | undefined | |
moveLimit (optional) | number | undefined | |
tools | boolean |
Examples
import { createGame } from "@johnmorrisdotca/houseki/stone-collapse";
import type { Settings } from "@johnmorrisdotca/houseki/stone-collapse";
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', 'tools' ]What it prints (run when this page was built)