StackUpGame型
リファレンスの説明と例は英語です。見出しと目次は日本語です。
A game of Stack Up: every seat's stock, hand and four discard piles, the four building piles, the cards still to draw and the finished piles waiting to be shuffled back in.
インポート
import type { StackUpGame } from "@johnmorrisdotca/toranpu/stack-up";
定義
type StackUpGame = KeptCardGame<StackUpMove> & {
phase: "playing" | "over";
toPlay: number | null;
stocks: CardId[][];
hands: CardId[][];
discards: CardId[][][];
building: CardId[][];
draw: CardId[];
done: CardId[];
reshuffles: number;
played: boolean;
idle: number;
ended: StackUpEnd | null;
};
メンバー
| 名前 | 型 | 説明 |
|---|---|---|
size | number | |
players | readonly string[] | |
computers | readonly boolean[] | |
seed | number | |
moves | readonly StackUpMove[] | |
phase | "playing" | "over" | |
toPlay | number | null | |
stocks | string[][] | Each seat's stock, face down but for the top card, which is the last. |
hands | string[][] | |
discards | string[][][] | Each seat's four discard piles, the top card of each last. |
building | string[][] | The four building piles: a pile of n cards wants an n + 1 next, up to 12. |
draw | string[] | |
done | string[] | Finished piles of twelve, shuffled back into the draw pile when it runs out. |
reshuffles | number | |
played | boolean | Whether the seat to play has played a card this turn. |
idle | number | Turns in a row that ended with nothing played. |
ended | StackUpEnd | null |
例
import type { StackUpGame } from "@johnmorrisdotca/toranpu/stack-up";
import { newGame } from "@johnmorrisdotca/toranpu";
const value: StackUpGame = newGame("stackUp", { players: ["Aki", "Ben"], seed: 42 })!;
console.log(value.building.length);4出力(このページを作ったときに実行した結果)
この日本語は、まだ日本語を母語とする方の確認を受けていません。訂正を歓迎します。