MahjongLayout型
リファレンスの説明と例は英語です。見出しと目次は日本語です。
A stacked layout: its slots in reading order (layer by layer, row by row), which is the order a deal is written in.
インポート
import type { MahjongLayout } from "@johnmorrisdotca/jarajara";
定義
type MahjongLayout = {
size: number;
key: string;
slots: readonly MahjongSlot[];
};
メンバー
| 名前 | 型 | 説明 |
|---|---|---|
size | number | The layout's width in tiles: its "size", unique among the layouts. |
key | string | |
slots | readonly MahjongSlot[] |
例
import { layoutFor } from "@johnmorrisdotca/jarajara";
import type { MahjongLayout } from "@johnmorrisdotca/jarajara";
const layout = layoutFor(4)!;
const value: MahjongLayout = layout;
console.log(value);{
size: 4,
key: 'tiny',
slots: [
{ x: 0, y: 0, z: 0 },
{ x: 2, y: 0, z: 0 },
{ x: 4, y: 0, z: 0 },
{ x: 6, y: 0, z: 0 },
{ x: 1, y: 0, z: 1 },
{ x: 3, y: 0, z: 1 },
{ x: 5, y: 0, z: 1 },
{ x: 3, y: 0, z: 2 }
]
}出力(このページを作ったときに実行した結果)
この日本語は、まだ日本語を母語とする方の確認を受けていません。訂正を歓迎します。