Settingstype
Validated settings fixed at native game creation.
Import it
import type { Settings } from "@johnmorrisdotca/houseki/falling-triplets";
Definition
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[];
}
Members
| Name | Type | Description |
|---|---|---|
mode | Mode | |
width | number | |
height | number | |
colourCount | 4 | 5 | 6 | |
seed | string | |
pieceLimit (optional) | number | undefined | |
goal (optional) | "targets" | "chain" | "empty" | undefined | |
targetIds (optional) | readonly number[] | undefined | |
minimumChain (optional) | number | undefined | |
challengeBoard (optional) | readonly (Gem | null)[] | undefined | |
challengeQueue (optional) | readonly Triplet[] | undefined | |
witness (optional) | readonly ChallengeHint[] | undefined |
Examples
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' ]What it prints (run when this page was built)