Hand - lcrocker/ojpoker GitHub Wiki
Hand
This is the more complete of the two classes implementing HandInterface.
Every Hand
is associated with a Deck
, and is created from it, e.g.:
var d = Deck("poker");
var h = d.newHand();
These have many convenience functions useful for implementing player hands
in card games, for example, h.draw(2)
will cause the hand to be dealt two
cards from its associated deck. The Hand
also uses its associated deck
for error checking: for example, a hand from a Spanish deck would allow
knights/cavaliers, where a hand from a Pinochle deck would not; but the
latter would allow two nines of diamonds, while a hand from a poker deck
would not.