public class Card
extends java.lang.Object
Card
class contains all the information a card can contain,
statistics on cards type, number and max number and a list of already
instantiated cards to check card uniqueness
because there can't be multiple card with same suit and rank
In this game there are only 78 cards :
- 56 Classic cards
- 21 Trump cards
- 1 Excuse cardModifier and Type | Class and Description |
---|---|
static class |
Card.CardComparator
The
CardComparator class compares two cards
following their Rank and Suit |
Constructor and Description |
---|
Card()
Constructs a void card
|
Card(Suit suit,
int rank)
Constructs a trump card with a suit and a trump rank
or the excuse with a null rank
|
Card(Suit suit,
Rank rank)
Constructs a card with a suit and a rank
|
Modifier and Type | Method and Description |
---|---|
java.lang.String |
getName() |
static int |
getNbCards() |
static int |
getNbMaxCards() |
static int |
getNbMaxTrumps() |
Rank |
getRank() |
Suit |
getSuit() |
boolean |
isShown() |
static void |
resetClass()
Reset static field
|
void |
setShown(boolean shown) |
public Card() throws CardNumberException
CardNumberException
- if user tries to create too much cardspublic Card(Suit suit, Rank rank) throws CardNumberException, CardUniquenessException
suit
- defines card suitrank
- defines card rankCardNumberException
- if user tries to create too much cardsCardUniquenessException
- if user tries to create too identical cardspublic Card(Suit suit, int rank) throws CardNumberException, CardUniquenessException
suit
- defines card suitrank
- defines card rankCardNumberException
- if user tries to create too much cardsCardUniquenessException
- if user tries to create too identical cardspublic static void resetClass()
public static int getNbCards()
public static int getNbMaxCards()
public static int getNbMaxTrumps()
public java.lang.String getName()
public Suit getSuit()
public Rank getRank()
public boolean isShown()
public void setShown(boolean shown)