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 representationvoidRemoves the information of which side was playedintGenerates 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 sidesvoidsetCoveredCorners(int coveredCorners) voidsetPlayedSideType(CardSideType playedSideType) Methods inherited from class polimi.ingsw.am21.codex.model.Cards.Card
getId, getImagePath, getImagePathMethods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods 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:CardGenerates a function that, when called by passing the player board, returns the points of the card.- Specified by:
getEvaluatorin classCard
-
cardToAscii
Description copied from interface:CliCardConverts 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
-