Settingstype
Validated settings fixed at native game creation.
Import it
import type { Settings } from "@johnmorrisdotca/houseki/gem-swap";
Definition
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[];
}
Members
| Name | Type | Description |
|---|---|---|
width | number | |
height | number | |
colourCount | 4 | 5 | 6 | |
seed | string | number | |
tools | boolean | |
advancedTools | boolean | |
shape (optional) | BoardShape | undefined | |
mask | readonly boolean[] |
Examples
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' ]What it prints (run when this page was built)