queuedPiecefunction
The piece the colour to move must lay next, or null outside the piece games.
Import it
import { queuedPiece } from "@johnmorrisdotca/narabe";
Definition
function queuedPiece(state: GameState): Piece | null
Parameters
| Name | Type | Description |
|---|---|---|
state | GameState | The current immutable game position. |
Returns
Piece | null
The piece in hand, or null when this variant has no piece queue.
Examples
import { createGame, queuedPiece } from "@johnmorrisdotca/narabe";
const queued = createGame({variant:"dominoFive",seed:42});
console.log(queuedPiece(queued));{
cells: [
{ row: 0, col: 0, stone: 'white' },
{ row: 0, col: 1, stone: 'black' }
]
}What it prints (run when this page was built)