CARD_GAME_RULESconstant
EVERY CARD GAME'S RULES, by kind: what a table plays and what the simulation plays out. A mapped type, so a new card game does not compile until its rules are here.
Import it
import { CARD_GAME_RULES } from "@johnmorrisdotca/toranpu";
Definition
const CARD_GAME_RULES: { spades: CardGameRules<SpadesGame, SpadesMove>; hearts: CardGameRules<HeartsGame, HeartsMove>; bigTwo: CardGameRules<BigTwoGame, ClimbMove>; president: CardGameRules<PresidentGame, PresidentMove>; goFish: CardGameRules<GoFishGame, GoFishMove>; crazyEights: CardGameRules<CrazyEightsGame, CrazyEightsMove>; ginRummy: CardGameRules<GinGame, GinMove>; euchre: CardGameRules<EuchreGame, EuchreMove>; cribbage: CardGameRules<CribbageGame, CribbageMove>; ohHell: CardGameRules<OhHellGame, OhHellMove>; war: CardGameRules<WarGame, WarMove>; } = {
hearts: HEARTS_RULES,
bigTwo: BIG_TWO_RULES,
president: PRESIDENT_RULES,
goFish: GO_FISH_RULES,
crazyEights: CRAZY_EIGHTS_RULES,
spades: SPADES_RULES,
ginRummy: GIN_RUMMY_RULES,
euchre: EUCHRE_RULES,
cribbage: CRIBBAGE_RULES,
ohHell: OH_HELL_RULES,
war: WAR_RULES,
}
Members
| Name | Type | Description |
|---|---|---|
spades | CardGameRules<SpadesGame, SpadesMove> | |
hearts | CardGameRules<HeartsGame, HeartsMove> | |
bigTwo | CardGameRules<BigTwoGame, ClimbMove> | |
president | CardGameRules<PresidentGame, PresidentMove> | |
goFish | CardGameRules<GoFishGame, GoFishMove> | |
crazyEights | CardGameRules<CrazyEightsGame, CrazyEightsMove> | |
ginRummy | CardGameRules<GinGame, GinMove> | |
euchre | CardGameRules<EuchreGame, EuchreMove> | |
cribbage | CardGameRules<CribbageGame, CribbageMove> | |
ohHell | CardGameRules<OhHellGame, OhHellMove> | |
war | CardGameRules<WarGame, WarMove> |
Examples
import { CARD_GAME_RULES } from "@johnmorrisdotca/toranpu";
console.log(Object.keys(CARD_GAME_RULES));[
'hearts', 'bigTwo',
'president', 'goFish',
'crazyEights', 'spades',
'ginRummy', 'euchre',
'cribbage', 'ohHell',
'war'
]What it prints (run when this page was built)