public class Deck extends Object implements Serializable
Constructor and Description |
---|
Deck() |
Deck(Deck deck)
Provides a clone of the given deck
|
Modifier and Type | Method and Description |
---|---|
void |
add(Card card)
Add a new card to the deck.
|
boolean |
equals(Object o) |
int |
getCardsLeft()
Gets the number of cards left in the deck
|
Card |
getTopCard()
Gets and removes the top card from the deck
|
boolean |
hasCardsLeft()
Are there any cards left in the deck?
|
int |
hashCode() |
void |
init()
Initialises the deck of cards with a complete set for the game
|
void |
remove(Card card) |
void |
shuffle()
shuffle this deck of cards.
|
void |
shuffle(long seed)
shuffle this deck with a prefined seed
|
void |
sort() |
List<Card> |
toList() |
public Deck()
public Deck(Deck deck)
A shallow copy - but the cards themselves are immutable so no problem.
deck
- The given deck to be clonedpublic void add(Card card)
card
- the card to addpublic int getCardsLeft()
public Card getTopCard()
public boolean hasCardsLeft()
public void init()
public void shuffle()
public void sort()
public void shuffle(long seed)
public void remove(Card card)
Copyright © 2017 FOSS Galaxy. All rights reserved.