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 if there are more cards in the deck
|
Card |
nextCard()
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
- list of cards to build deck withpublic boolean hasNextCard()
public Card nextCard()
java.lang.IllegalStateException
- if deck does not contain any cardspublic void putCard(Card card)
card
- Card to be placed in deck