Class PlayableCard
java.lang.Object
it.polimi.ingsw.gc14.Model.PlayableCard
- All Implemented Interfaces:
Serializable
- Direct Known Subclasses:
BuildingCard, TribeCard
Abstract base class for all playable cards.
A PlayableCard is characterized by an era value.
- See Also:
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionPlayableCard(int era) Creates a playable card with the specified era.PlayableCard(String idIMG, int era) Creates a playable card with the specified image id and era. -
Method Summary
Modifier and TypeMethodDescriptionintgetEra()Returns the era of this playable card.getIdIMG()Returns the image identifier of this playable card.abstract StringReturns the representation shown on the board (offer track cards).abstract StringReturns the compact representation shown in the player hand panel.
-
Field Details
-
idIMG
The image identifier of the playable card. -
era
private final int eraThe era associated with this playable card.
-
-
Constructor Details
-
PlayableCard
Creates a playable card with the specified era.- Parameters:
era- the era of the playable card.- Throws:
IllegalArgumentException- ifera <= 0orera >= 4.
-
PlayableCard
Creates a playable card with the specified image id and era.- Parameters:
idIMG- the image identifier of the playable card.era- the era of the playable card.- Throws:
IllegalArgumentException- ifera <= 0orera >= 4.
-
-
Method Details
-
getIdIMG
Returns the image identifier of this playable card.- Returns:
- the image identifier of this playable card.
-
getEra
public int getEra()Returns the era of this playable card.- Returns:
- the era of this playable card.
-
toStringPlayer
Returns the compact representation shown in the player hand panel.- Returns:
- the player-hand string representation of this card.
-
toStringBoard
Returns the representation shown on the board (offer track cards).- Returns:
- the board string representation of this card.
-