Move型
リファレンスの説明と例は英語です。見出しと目次は日本語です。
A move rebuilt by the engine, including captures and other replay effects.
インポート
import type { Move } from "@johnmorrisdotca/narabe";
定義
type Move = Point & {
stone: Stone;
by?: Stone;
kind: MoveKind;
captured?: Point[];
from?: Point;
twist?: Twist;
cleared?: Cell[];
cells?: PieceCell[];
wasKing?: boolean;
capturedWasKing?: boolean;
continuedChain?: boolean;
crowned?: boolean;
forced?: boolean;
headStart?: boolean;
koPointBefore?: Point | null;
};
メンバー
| 名前 | 型 | 説明 |
|---|---|---|
row | number | |
col | number | |
stone | Stone | The colour of the stone placed. |
by (省略可) | Stone | undefined | The colour that moved, when the game lets a mover place the other colour. |
kind | MoveKind | |
captured (省略可) | Point[] | undefined | Opponent stones this move took off the board, in the capture variants. |
from (省略可) | Point | undefined | Where a moving piece came from. Only on |
twist (省略可) | Twist | undefined | The twist that finished this move, once it has been made. |
cleared (省略可) | Cell[] | undefined | The bottom row this move cleared, so it can be put back by an undo. |
cells (省略可) | PieceCell[] | undefined | The cells a piece covered, with their colours, on |
wasKing (省略可) | boolean | undefined | Whether the piece making this move was already a king. Checkers only, for undo. |
capturedWasKing (省略可) | boolean | undefined | Whether the piece this move captured was itself a king. Checkers only, for undo. |
continuedChain (省略可) | boolean | undefined | Whether this move continued a capture chain already under way. Checkers only, for undo. |
crowned (省略可) | boolean | undefined | Whether this move crowned the piece that made it. Checkers only, and only where it did: an endgame count reads the record back to the move that entered its ending, and a man becoming a king changes which ending it is. |
forced (省略可) | boolean | undefined | On a pass: whether it was forced — the colour had nothing it could play —
rather than chosen, as a pass in Go is. Set by |
headStart (省略可) | boolean | undefined | On a pass: whether it was a turn the other colour's head start took —
see |
koPointBefore (省略可) | Point | null | undefined | The ko point in force just before this move, so undo can put it back. Go only. |
例
import type { Move } from "@johnmorrisdotca/narabe";
const value: Move = {row:7,col:7,stone:"black",kind:"place"};
console.log(value);{ row: 7, col: 7, stone: 'black', kind: 'place' }出力(このページを作ったときに実行した結果)
この日本語は、まだ日本語を母語とする方の確認を受けていません。訂正を歓迎します。