CellModel型
リファレンスの説明と例は英語です。見出しと目次は日本語です。
Accessible presentation data for one active board cell.
インポート
import type { CellModel } from "@johnmorrisdotca/jirai/draw";
定義
type CellModel = {
cell: number;
x: number;
y: number;
width: number;
height: number;
label: string;
text: string;
kind: string;
hint: boolean;
};
メンバー
| 名前 | 型 | 説明 |
|---|---|---|
cell | number | |
x | number | |
y | number | |
width | number | |
height | number | |
label | string | |
text | string | |
kind | string | |
hint | boolean |
例
import type { Settings } from "@johnmorrisdotca/jirai";
import { newGame, play } from "@johnmorrisdotca/jirai";
import type { CellModel } from "@johnmorrisdotca/jirai/draw";
import { boardModel } from "@johnmorrisdotca/jirai/draw";
const settings: Settings={width:3,height:3,mines:1,grid:"square",noGuess:false,opening:"clear",seed:42};
const game=play(newGame(settings),{kind:"reveal",cell:0});
const value: CellModel = boardModel(game).cells[0]!;
console.log(value);{
cell: 0,
x: 0,
y: 0,
width: 1,
height: 1,
label: '1, 1: empty',
text: '',
kind: 'open',
hint: false
}出力(このページを作ったときに実行した結果)
この日本語は、まだ日本語を母語とする方の確認を受けていません。訂正を歓迎します。