Reference · Shizen and Arashi environments
EnvironmentTransitiontype
The committed environment state, event list and pure preview.
Import it
import type { EnvironmentTransition } from "@johnmorrisdotca/houseki/nature";
Definition
interface EnvironmentTransition {
readonly state: NatureState;
readonly accepted: true;
readonly events: readonly EnvironmentEvent[];
readonly preview: EnvironmentPreview;
}
Members
| Name | Type | Description |
|---|---|---|
state | NatureState | |
accepted | true | |
events | readonly EnvironmentEvent[] | |
preview | EnvironmentPreview |
Examples
import { applyLightning, createNatureState } from "@johnmorrisdotca/houseki/nature";
import type { EnvironmentTransition } from "@johnmorrisdotca/houseki/nature";
const state=createNatureState({width:4,height:4,seed:"docs"});
const value: EnvironmentTransition = applyLightning(state,{columns:[0]});
console.log(value == null ? value : typeof value === "object" ? Object.keys(value).slice(0,6) : value);[ 'state', 'accepted', 'events', 'preview' ]What it prints (run when this page was built)