public class Deck
extends java.lang.Object
Constructor and Description |
---|
Deck()
Constructs a regular 52-card poker deck.
|
Deck(boolean includeJokers)
Constructs a poker deck of plaing cards, The deck contains
the ususal 52 cards and can optionally contain two Jokers
in addtion, for a total of 54 cards.
|
Modifier and Type | Method and Description |
---|---|
int |
cardsLeft()
As cards are dealt from the deck, the number of cards left
decreases.
|
Card |
dealCard()
Removes the next card from the deck and return it.
|
boolean |
hasJokers()
Test whether the deck contains Jokers.
|
void |
shuffle()
Put all the used cards back into the deck (if any), and
shuffle the deck into a random order.
|
public Deck()
public Deck(boolean includeJokers)
includeJokers
- if true, two Jokers are included in the deck; if false,
there are no Jokers in the deck.public void shuffle()
public int cardsLeft()
public Card dealCard()
java.lang.IllegalStateException
- if there are no cards left in the deckpublic boolean hasJokers()