legalActionsfunction
Lists accepted controls for the current falling or resolution phase.
Import it
import { legalActions } from "@johnmorrisdotca/houseki/magnetic-blocks";
Definition
function legalActions(state: GameState): readonly Action[]
Parameters
| Name | Type | Description |
|---|---|---|
state | GameState | The immutable native state to read or transition; the input is retained. |
Returns
readonly Action[]
Lists accepted controls for the current falling or resolution phase.
Examples
import { createGame, legalActions } from "@johnmorrisdotca/houseki/magnetic-blocks";
const state=createGame({seed:"docs"});
console.log(legalActions(state).length);8What it prints (run when this page was built)