Piece型
リファレンスの説明と例は英語です。見出しと目次は日本語です。
A shape in the tray: its name, its colour, and its cells as row and column from its own top left.
インポート
import type { Piece } from "@johnmorrisdotca/houseki/tsumiki";
定義
interface Piece {
readonly shape: string;
readonly colour: BlockColour;
readonly cells: readonly (readonly [
number,
number
])[];
}
メンバー
| 名前 | 型 | 説明 |
|---|---|---|
shape | string | |
colour | BlockColour | |
cells | readonly (readonly [number, number])[] |
例
import type { Piece } from "@johnmorrisdotca/houseki/tsumiki";
const value: Piece = { shape: "bar-2", colour: "blue", cells: [[0, 0], [0, 1]] };
console.log(value.cells.length);2出力(このページを作ったときに実行した結果)
この日本語は、まだ日本語を母語とする方の確認を受けていません。訂正を歓迎します。