StackUpMove型
リファレンスの説明と例は英語です。見出しと目次は日本語です。
One move at Stack Up: a card laid on a building pile (from the hand, the top of the stock, or the top of one of your own discard piles), a card put on a discard pile, which ends the turn, or a pass when there is nothing in hand to discard.
インポート
import type { StackUpMove } from "@johnmorrisdotca/toranpu/stack-up";
定義
type StackUpMove = {
play: CardId;
from: "hand" | "stock";
to: number;
} | {
play: CardId;
from: "discard";
pile: number;
to: number;
} | {
discard: CardId;
to: number;
} | {
pass: true;
};
例
import type { StackUpMove } from "@johnmorrisdotca/toranpu/stack-up";
const value: StackUpMove = { play: "n01", from: "hand", to: 0 };
console.log(value);{ play: 'n01', from: 'hand', to: 0 }出力(このページを作ったときに実行した結果)
この日本語は、まだ日本語を母語とする方の確認を受けていません。訂正を歓迎します。