GameStatus型
リファレンスの説明と例は英語です。見出しと目次は日本語です。
A compact native status derived from the authoritative state for a host’s labels.
インポート
import type { GameStatus } from "@johnmorrisdotca/houseki/magnetic-blocks";
定義
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;
}
メンバー
| 名前 | 型 | 説明 |
|---|---|---|
phase | Phase | |
score | number | |
moves | number | |
placements | number | |
floor | Floor | |
nextFloor | Floor | |
floorSwitchCharges | number | |
pendingFloorOverride | Floor | null | |
maxChain | number | |
reason (省略可) | string | undefined |
例
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' ]出力(このページを作ったときに実行した結果)
この日本語は、まだ日本語を母語とする方の確認を受けていません。訂正を歓迎します。