Reference · Shizen and Arashi environments
LightningPreviewtype
A pure selected-column removal and resulting occupants/random state.
Import it
import type { LightningPreview } from "@johnmorrisdotca/houseki/nature";
Definition
interface LightningPreview {
readonly columns: readonly number[];
readonly removedCells: readonly number[];
readonly removedIds: readonly number[];
readonly cells: readonly (NatureEntity | null)[];
readonly randomStateAfter: number;
}
Members
| Name | Type | Description |
|---|---|---|
columns | readonly number[] | |
removedCells | readonly number[] | |
removedIds | readonly number[] | |
cells | readonly (NatureEntity | null)[] | |
randomStateAfter | number |
Examples
import { createNatureState, previewLightning } from "@johnmorrisdotca/houseki/nature";
import type { LightningPreview } from "@johnmorrisdotca/houseki/nature";
const state=createNatureState({width:4,height:4,seed:"docs"});
const value: LightningPreview = previewLightning(state,{columns:[0]});
console.log(value == null ? value : typeof value === "object" ? Object.keys(value).slice(0,6) : value);[
'columns',
'removedCells',
'removedIds',
'cells',
'randomStateAfter'
]What it prints (run when this page was built)