public class Deck extends com.threerings.util.StreamableArrayList<Card> implements CardCodes
| Constructor and Description |
|---|
Deck()
Default constructor creates an unshuffled deck of cards without
jokers.
|
Deck(boolean includeJokers)
Constructor.
|
| Modifier and Type | Method and Description |
|---|---|
Hand |
dealHand(int size)
Deals a hand of cards from the deck.
|
void |
reset(boolean includeJokers)
Resets the deck to its initial state: an unshuffled deck of
52 or 54 cards, depending on whether the jokers are included.
|
void |
returnHand(Hand hand)
Returns a hand of cards to the deck.
|
void |
shuffle()
Shuffles the deck.
|
void |
shuffle(Random r)
Shuffles the deck.
|
newList, readObject, writeObjectadd, add, addAll, addAll, clear, clone, contains, ensureCapacity, forEach, get, indexOf, isEmpty, iterator, lastIndexOf, listIterator, listIterator, remove, remove, removeAll, removeIf, replaceAll, retainAll, set, size, sort, spliterator, subList, toArray, toArray, trimToSizeequals, hashCodecontainsAll, toStringcontainsAll, equals, hashCodeparallelStream, streampublic Deck()
public Deck(boolean includeJokers)
includeJokers - whether or not to include the two jokers
in the deckpublic void reset(boolean includeJokers)
includeJokers - whether or not to include the two jokers
in the deckpublic void shuffle()
public void shuffle(Random r)
public Hand dealHand(int size)
size - the size of the hand to dealpublic void returnHand(Hand hand)
hand - the hand of cards to returnCopyright © 2015. All rights reserved.