LightningPreview型
リファレンスの説明と例は英語です。見出しと目次は日本語です。
A pure selected-column removal and resulting occupants/random state.
インポート
import type { LightningPreview } from "@johnmorrisdotca/houseki/nature";
定義
interface LightningPreview {
readonly columns: readonly number[];
readonly removedCells: readonly number[];
readonly removedIds: readonly number[];
readonly cells: readonly (NatureEntity | null)[];
readonly randomStateAfter: number;
}
メンバー
| 名前 | 型 | 説明 |
|---|---|---|
columns | readonly number[] | |
removedCells | readonly number[] | |
removedIds | readonly number[] | |
cells | readonly (NatureEntity | null)[] | |
randomStateAfter | number |
例
import { createNatureState, previewLightning } from "@johnmorrisdotca/houseki/nature";
import type { LightningPreview } from "@johnmorrisdotca/houseki/nature";
const state=createNatureState({width:4,height:4,seed:"docs"});
const value: LightningPreview = previewLightning(state,{columns:[0]});
console.log(value == null ? value : typeof value === "object" ? Object.keys(value).slice(0,6) : value);[
'columns',
'removedCells',
'removedIds',
'cells',
'randomStateAfter'
]出力(このページを作ったときに実行した結果)
この日本語は、まだ日本語を母語とする方の確認を受けていません。訂正を歓迎します。