本文へ移動

Houseki宝石

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

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

目次

リファレンス · 色の連鎖

Settings型

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

Run settings fixed at game creation.

インポート

import type { Settings } from "@johnmorrisdotca/houseki/colour-chains";

定義

interface Settings {
    readonly mode: Mode;
    readonly width: number;
    readonly height: number;
    readonly colourCount: 4 | 5 | 6;
    readonly seed: string;
    readonly date?: string;
    readonly pairLimit?: number;
    readonly nature?: true;
    readonly weather?: WeatherSchedule;
    readonly challengeId?: string;
    readonly goal?: ChallengeGoal;
    readonly initialBoard?: readonly (ChallengeGem | null)[];
    readonly queue?: readonly (readonly [
        Colour,
        Colour
    ])[];
    readonly magneticQueue?: readonly (readonly [
        boolean,
        boolean
    ])[];
    readonly witness?: readonly WitnessStep[];
}

メンバー

名前型説明
modeMode
widthnumber
heightnumber
colourCount4 | 5 | 6
seedstring
date (省略可)string | undefined
pairLimit (省略可)number | undefined
nature (省略可)true | undefined
weather (省略可)WeatherSchedule | undefined
challengeId (省略可)string | undefined
goal (省略可)ChallengeGoal | undefined
initialBoard (省略可)readonly (Gem | null)[] | undefined
queue (省略可)readonly (readonly [Colour, Colour])[] | undefined
magneticQueue (省略可)readonly (readonly [boolean, boolean])[] | undefined
witness (省略可)readonly WitnessStep[] | undefined

例

import { createGame } from "@johnmorrisdotca/houseki/colour-chains";
import type { Settings } from "@johnmorrisdotca/houseki/colour-chains";

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 のソースから作成しました。

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