MoveOftype
A move in a game of that kind.
Import it
import type { MoveOf } from "@johnmorrisdotca/toranpu";
Definition
type MoveOf<K extends CardGameKind> = CardGamePlays[K]["move"];
Examples
import { newGame, rulesFor } from "@johnmorrisdotca/toranpu";
import type { MoveOf } from "@johnmorrisdotca/toranpu";
const game = newGame("hearts", { players: ["Aki", "Ben", "Cy", "Dev"], seed: 42 })!;
const value: MoveOf<"hearts"> = rulesFor("hearts").moves(game)[0]!;
console.log(value);{ pass: [ '2C', '3C', '7C' ] }What it prints (run when this page was built)