replayTrain関数
リファレンスの説明と例は英語です。見出しと目次は日本語です。
A game played again from its table and its moves: what reading a kept game back does. Null if any move is one the rules would not have taken.
インポート
import { replayTrain } from "@johnmorrisdotca/domino";
定義
function replayTrain(set: number, players: readonly string[], seed: number, options: TrainOptions, computers: readonly boolean[], moves: readonly TrainMove[]): TrainGame | null
引数
| 名前 | 型 | 説明 |
|---|---|---|
set | number | The highest double of the supported set: 9, 12 or 15. |
players | readonly string[] | Player count, or names in seat order, as specified by this signature. |
seed | number | The seed for reproducible shuffles. |
options | TrainOptions | Native sound-player choices or Mexican Train house rules specified by the signature. |
computers | readonly boolean[] | Which seats are computer-controlled, in player order. |
moves | readonly TrainMove[] | Recorded native moves in chronological order. |
戻り値
TrainGame | null
A game played again from its table and its moves: what reading a kept game back does. null if any move is one the rules would not have taken.
例
import { movesOf, playTrain, replayTrain, startTrain, trainMoves } from "@johnmorrisdotca/domino";
const game = startTrain(9,["A","B"],42,{length:"short",doubles:"one",mexican:"any"},[false,true])!;
const moved = playTrain(game,trainMoves(game)[0])!;
console.log(replayTrain(game.set,game.players,game.seed,game.options,game.computers,movesOf(moved))?.turn);1出力(このページを作ったときに実行した結果)
この日本語は、まだ日本語を母語とする方の確認を受けていません。訂正を歓迎します。