Class TribeCard
java.lang.Object
it.polimi.ingsw.gc14.Model.PlayableCard
it.polimi.ingsw.gc14.Model.Cards.TribeCard
- All Implemented Interfaces:
Serializable
Abstract base class for all tribe cards.
A TribeCard is a
PlayableCard that may either be an event card
or a non-event card, and may optionally specify a minimum number of players.- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final booleanIndicates whether this tribe card is an event card.private final intThe minimum number of players required for this tribe card. -
Constructor Summary
ConstructorsConstructorDescriptionTribeCard(int Era, boolean isEventCard) Creates a tribe card with the specified era and event-card flag.TribeCard(int Era, boolean isEventCard, int nMin) Creates a tribe card with the specified era, event-card flag, and minimum number of players.Creates a tribe card with the specified image id, era and event-card flag.Creates a tribe card with the specified image id, era, event-card flag, and minimum number of players. -
Method Summary
Methods inherited from class PlayableCard
getEra, getIdIMG, toStringBoard, toStringPlayer
-
Field Details
-
isEventCard
private final boolean isEventCardIndicates whether this tribe card is an event card. -
nMin
private final int nMinThe minimum number of players required for this tribe card.
-
-
Constructor Details
-
TribeCard
public TribeCard(int Era, boolean isEventCard) Creates a tribe card with the specified era and event-card flag. The minimum number of players is set to 0.- Parameters:
Era- the era of the tribe card.isEventCard- whether the card is an event card.
-
TribeCard
Creates a tribe card with the specified image id, era and event-card flag. The minimum number of players is set to 0.- Parameters:
idIMG- the image identifier of the tribe card.Era- the era of the tribe card.isEventCard- whether the card is an event card.
-
TribeCard
public TribeCard(int Era, boolean isEventCard, int nMin) Creates a tribe card with the specified era, event-card flag, and minimum number of players.- Parameters:
Era- the era of the tribe card.isEventCard- whether the card is an event card.nMin- the minimum number of players required for the card.
-
TribeCard
Creates a tribe card with the specified image id, era, event-card flag, and minimum number of players.- Parameters:
idIMG- the image identifier of the tribe card.Era- the era of the tribe card.isEventCard- whether the card is an event card.nMin- the minimum number of players required for the card.
-
-
Method Details
-
isEventCard
public boolean isEventCard()Returns whether this tribe card is an event card.- Returns:
trueif this card is an event card,falseotherwise.
-
getNMin
public int getNMin()Returns the minimum number of players required for this tribe card.- Returns:
- the minimum number of players required for this tribe card.
-
clone
-