Skip to content

Reference

tilttek/card-deck

Every public type of the package, with its role.

TypeRole
CardA card: its identifier, 1 to 16 faces and a back
CardId, PlayerId, GameIdOpaque identifiers of a card, a player and a game
FaceWhat one side of a card shows, as a key
Deck1 to 1 024 cards in their declared order, written to an array and read back
StandardDeckThe 52 cards of the French-suited deck and its jokers
ZoneId, ZoneKindA zone — draw pile, discard pile, table, hand, named pile — and its kind
Gesture\GestureA gesture of the journal, written to an array
Gesture\Shuffle, Draw, Deal, Discard, Flip, TurnFace, Move, CollectThe gestures
Gesture\Pick, Gesture\EndWhere a card is drawn from, and where it lands
Gesture\GestureCodecReads back the gestures written to arrays
DeckStateThe whole state of a game: start, apply, replay, fingerprint, and the zones as a player sees them
ShufflerThe Fisher-Yates shuffle on a randomizer
View\PlayerView, View\ZoneView, View\SeenCardWhat a player may see of a game, zone by zone, card by card
CardTableOpens, starts, plays, shows and finishes the games of a store
GameRecordWhat a store keeps of a game, with its version
RevealA finished game, published for anyone to verify
Contract\GameStoreThe store port
Store\InMemoryGameStoreThe store in memory, for tests
Exception\CardDeckException and its four exceptionsExceptions