blockCells関数
リファレンスの説明と例は英語です。見出しと目次は日本語です。
Returns stable-gem addresses after rotating the square block around its centre.
インポート
import { blockCells } from "@johnmorrisdotca/houseki/magnetic-blocks";
定義
function blockCells(block: Block, width: number): readonly { readonly index: number; readonly gem: Gem; }[]
引数
| 名前 | 型 | 説明 |
|---|---|---|
block | Block | The native active 2×2 block and its stable gem ids. |
width | number | The native board width in cells. |
戻り値
readonly { readonly index: number; readonly gem: Gem; }[]
Returns stable-gem addresses after rotating the square block around its centre.
例
import { blockCells, createGame } from "@johnmorrisdotca/houseki/magnetic-blocks";
const state=createGame({seed:"docs"});
console.log(blockCells(state.active!,state.settings.width).length);4出力(このページを作ったときに実行した結果)
この日本語は、まだ日本語を母語とする方の確認を受けていません。訂正を歓迎します。