本文へ移動

Houseki宝石

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

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

目次

リファレンス · 自然と嵐の環境

NatureOptions型

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

The native grid dimensions, passability mask, occupants, seed and magnetic/rebound settings.

インポート

import type { NatureOptions } from "@johnmorrisdotca/houseki/nature";

定義

interface NatureOptions {
    readonly width: number;
    readonly height: number;
    readonly seed?: string;
    readonly activeCells?: readonly boolean[];
    readonly cells?: readonly (NatureEntity | null)[];
    readonly magneticEnabled?: boolean;
    readonly reboundEnabled?: boolean;
    readonly reboundDirectionMode?: ReboundDirectionMode;
}

メンバー

名前型説明
widthnumber
heightnumber
seed (省略可)string | undefined
activeCells (省略可)readonly boolean[] | undefined

Row-major passability mask. False cells are permanent gaps and cannot hold pieces.

cells (省略可)readonly (NatureEntity | null)[] | undefined

Row-major initial occupants; false mask cells must be empty.

magneticEnabled (省略可)boolean | undefined
reboundEnabled (省略可)boolean | undefined
reboundDirectionMode (省略可)ReboundDirectionMode | undefined

例

import type { NatureOptions } from "@johnmorrisdotca/houseki/nature";

const value: NatureOptions = {width:4,height:4,seed:"docs"};
console.log(value == null ? value : typeof value === "object" ? Object.keys(value).slice(0,6) : value);
[ 'width', 'height', 'seed' ]

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

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

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