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;
}
メンバー
| 名前 | 型 | 説明 |
|---|---|---|
width | number | |
height | number | |
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' ]出力(このページを作ったときに実行した結果)
この日本語は、まだ日本語を母語とする方の確認を受けていません。訂正を歓迎します。