本文へ移動

Houseki宝石

5つの宝石と石のゲームの仕組みを使い、測定したチャレンジやレッスンで遊び、再現できるゲームを保存できます。

宝石(ほうせき)は、宝石や貴石を意味する日本語です。 名前について(英語)

目次

リファレンス · 三つの宝石

Settings型

リファレンスの説明と例は英語です。見出しと目次は日本語です。

Validated settings fixed at native game creation.

インポート

import type { Settings } from "@johnmorrisdotca/houseki/falling-triplets";

定義

interface Settings {
    readonly mode: Mode;
    readonly width: number;
    readonly height: number;
    readonly colourCount: 4 | 5 | 6;
    readonly seed: string;
    readonly pieceLimit?: number;
    readonly goal?: 'targets' | 'chain' | 'empty';
    readonly targetIds?: readonly number[];
    readonly minimumChain?: number;
    readonly challengeBoard?: readonly (Gem | null)[];
    readonly challengeQueue?: readonly Triplet[];
    readonly witness?: readonly ChallengeHint[];
}

メンバー

名前型説明
modeMode
widthnumber
heightnumber
colourCount4 | 5 | 6
seedstring
pieceLimit (省略可)number | undefined
goal (省略可)"targets" | "chain" | "empty" | undefined
targetIds (省略可)readonly number[] | undefined
minimumChain (省略可)number | undefined
challengeBoard (省略可)readonly (Gem | null)[] | undefined
challengeQueue (省略可)readonly Triplet[] | undefined
witness (省略可)readonly ChallengeHint[] | undefined

例

import { createGame } from "@johnmorrisdotca/houseki/falling-triplets";
import type { Settings } from "@johnmorrisdotca/houseki/falling-triplets";

const state=createGame({seed:"docs"});
const value: Settings = state.settings;
console.log(value == null ? value : typeof value === "object" ? Object.keys(value).slice(0,6) : value);
[ 'mode', 'width', 'height', 'colourCount', 'seed' ]

出力(このページを作ったときに実行した結果)

ソースを見るGitHub で編集@johnmorrisdotca/houseki 0.4.2 のソースから作成しました。

この日本語は、まだ日本語を母語とする方の確認を受けていません。訂正を歓迎します。