java.lang.Object
it.polimi.ingsw.am13.model.card.Card
it.polimi.ingsw.am13.model.card.CardPlayable
- All Implemented Interfaces:
CardIF
,CardPlayableIF
,Serializable
- Direct Known Subclasses:
CardGold
,CardResource
,CardStarter
Represents a card that can be played in player's field sometime during the game.
Hence, it could be a resource card, a gold card or a starter card.
It stores the information about the 2 sides belonging to the card.
Other information about the card played during the game are inherited from
Card
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final CardSidePlayable
Back (playable) side of this playable cardprivate final CardSidePlayable
Front (playable) side of this playable card -
Constructor Summary
ConstructorsConstructorDescriptionCardPlayable
(String id, CardSidePlayable front, CardSidePlayable back) Sets all immutable parameters of a playable card while creating a new one. -
Method Summary
Modifier and TypeMethodDescriptionIf the card is visible in field, retrieves the side that is visibleMethods inherited from class it.polimi.ingsw.am13.model.card.Card
equals, getId, getVisibleSide, hashCode, placeCardInField, removeCardFromField, toString
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
Methods inherited from interface it.polimi.ingsw.am13.model.card.CardIF
getId, getVisibleSide
-
Field Details
-
front
Front (playable) side of this playable card -
back
Back (playable) side of this playable card
-
-
Constructor Details
-
CardPlayable
Sets all immutable parameters of a playable card while creating a new one. The card is created not visible in field- Parameters:
id
- Id of the cardfront
- Front side of the cardback
- Back side of the card
-
-
Method Details
-
getSide
- Specified by:
getSide
in interfaceCardPlayableIF
- Parameters:
side
- Side whose card side is to be retrieved- Returns:
- Card side corresponding to specified side
-
getPlayedCardSide
If the card is visible in field, retrieves the side that is visible- Specified by:
getPlayedCardSide
in interfaceCardPlayableIF
- Returns:
- Visible card side of the card. Null if the card is not visible.
-