Skip to the content

Houseki宝石

Run five native gem and stone engines, play measured challenges and lessons, and save deterministic games.

Houseki (宝石) is Japanese for a gem or precious stone. About the name

Contents

Reference · Magnetic Blocks

GameStatustype

A compact native status derived from the authoritative state for a host’s labels.

Import it

import type { GameStatus } from "@johnmorrisdotca/houseki/magnetic-blocks";

Definition

interface GameStatus {
    readonly phase: Phase;
    readonly score: number;
    readonly moves: number;
    readonly placements: number;
    readonly floor: Floor;
    readonly nextFloor: Floor;
    readonly floorSwitchCharges: number;
    readonly pendingFloorOverride: Floor | null;
    readonly maxChain: number;
    readonly reason?: string;
}

Members

NameTypeDescription
phasePhase
scorenumber
movesnumber
placementsnumber
floorFloor
nextFloorFloor
floorSwitchChargesnumber
pendingFloorOverrideFloor | null
maxChainnumber
reason (optional)string | undefined

Examples

import { createGame, statusOf } from "@johnmorrisdotca/houseki/magnetic-blocks";
import type { GameStatus } from "@johnmorrisdotca/houseki/magnetic-blocks";

const state=createGame({seed:"docs"});
const value: GameStatus = statusOf(state);
console.log(value == null ? value : typeof value === "object" ? Object.keys(value).slice(0,6) : value);
[ 'phase', 'score', 'moves', 'placements', 'floor', 'nextFloor' ]

What it prints (run when this page was built)

View sourceEdit on GitHubMade from the source of @johnmorrisdotca/houseki 0.4.2.