Reference · Shizen and Arashi environments
NatureOptionstype
The native grid dimensions, passability mask, occupants, seed and magnetic/rebound settings.
Import it
import type { NatureOptions } from "@johnmorrisdotca/houseki/nature";
Definition
interface NatureOptions {
readonly width: number;
readonly height: number;
readonly seed?: string;
readonly activeCells?: readonly boolean[];
readonly cells?: readonly (NatureEntity | null)[];
readonly magneticEnabled?: boolean;
readonly reboundEnabled?: boolean;
readonly reboundDirectionMode?: ReboundDirectionMode;
}
Members
| Name | Type | Description |
|---|---|---|
width | number | |
height | number | |
seed (optional) | string | undefined | |
activeCells (optional) | readonly boolean[] | undefined | Row-major passability mask. False cells are permanent gaps and cannot hold pieces. |
cells (optional) | readonly (NatureEntity | null)[] | undefined | Row-major initial occupants; false mask cells must be empty. |
magneticEnabled (optional) | boolean | undefined | |
reboundEnabled (optional) | boolean | undefined | |
reboundDirectionMode (optional) | ReboundDirectionMode | undefined |
Examples
import type { NatureOptions } from "@johnmorrisdotca/houseki/nature";
const value: NatureOptions = {width:4,height:4,seed:"docs"};
console.log(value == null ? value : typeof value === "object" ? Object.keys(value).slice(0,6) : value);[ 'width', 'height', 'seed' ]What it prints (run when this page was built)