public class Deck
extends java.lang.Object
Constructor and Description |
---|
Deck()
Constructs an empty deck of cards
|
Deck(java.util.List<Card> cards)
Constructs a deck with the given list of cards.
|
Modifier and Type | Method and Description |
---|---|
boolean |
hasNextCard()
Returns true if there is a card remaining in the deck, false otherwise.
|
Card |
nextCard()
pre: The deck has another card, throws IllegalStateException otherwise.
Returns the card at the top of the deck |
void |
putCard(Card card)
Puts the given card at the top of the deck
|
public Deck()
public Deck(java.util.List<Card> cards)
cards
- The cards to construct the deck withpublic boolean hasNextCard()
public Card nextCard()
public void putCard(Card card)
card
- Card to place at top of deck