Module polimi.ingsw.am21.codex
Class PlayableCard
java.lang.Object
polimi.ingsw.am21.codex.model.Cards.Card
polimi.ingsw.am21.codex.model.Cards.Playable.PlayableCard
- All Implemented Interfaces:
GuiElement
,CliCard
-
Constructor Summary
ConstructorsConstructorDescriptionPlayableCard
(int id, PlayableFrontSide frontSide, PlayableBackSide backSide) PlayableCard
(int id, PlayableFrontSide frontSide, PlayableBackSide backSide, ResourceType kingdom) Constructor -
Method Summary
Modifier and TypeMethodDescriptioncardToAscii
(HashMap<Integer, String> cardStringMap) Converts the card to an ASCII representationvoid
Removes the information of which side was playedint
Generates a function that, when called by passing the player board, returns the points of the card.Gets the currently played side, if anygetSide
(CardSideType sideType) Gets the desired side of the cardgetSides()
A [front, back] list of sidesvoid
setCoveredCorners
(int coveredCorners) void
setPlayedSideType
(CardSideType playedSideType) Methods inherited from class polimi.ingsw.am21.codex.model.Cards.Card
getId, getImagePath, getImagePath
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface polimi.ingsw.am21.codex.view.TUI.utils.CliCard
cardToAscii
-
Constructor Details
-
PlayableCard
public PlayableCard(int id, PlayableFrontSide frontSide, PlayableBackSide backSide, ResourceType kingdom) Constructor- Parameters:
id
- A unique identifier for the cardfrontSide
- The front sidebackSide
- The back sidekingdom
- The kingdom this card is part of, if any (use null otherwise)
-
PlayableCard
-
-
Method Details
-
getKingdom
-
getPlayedSideType
-
getSides
A [front, back] list of sides -
getSide
Gets the desired side of the card- Parameters:
sideType
- The type of the side to get
-
getPlayedSide
Gets the currently played side, if any -
getBackPermanentResources
- Returns:
- the card's backPermanentResources
-
setPlayedSideType
- Parameters:
playedSideType
- The type of the side that has been played by the player
-
clearPlayedSide
public void clearPlayedSide()Removes the information of which side was played -
getCoveredCorners
public int getCoveredCorners() -
setCoveredCorners
public void setCoveredCorners(int coveredCorners) -
getEvaluator
Description copied from class:Card
Generates a function that, when called by passing the player board, returns the points of the card.- Specified by:
getEvaluator
in classCard
-
cardToAscii
Description copied from interface:CliCard
Converts the card to an ASCII representation- Parameters:
cardStringMap
- Maps the position of the item to the corresponding string to render inside the card- Returns:
- The rendered ASCII string
-
cardToString
-