java.lang.Object
polimi.ingsw.am21.codex.model.Cards.Card
polimi.ingsw.am21.codex.model.Cards.Playable.PlayableCard
All Implemented Interfaces:
GuiElement, CliCard

public class PlayableCard extends Card
  • Constructor Details

    • PlayableCard

      public PlayableCard(int id, PlayableFrontSide frontSide, PlayableBackSide backSide, ResourceType kingdom)
      Constructor
      Parameters:
      id - A unique identifier for the card
      frontSide - The front side
      backSide - The back side
      kingdom - The kingdom this card is part of, if any (use null otherwise)
    • PlayableCard

      public PlayableCard(int id, PlayableFrontSide frontSide, PlayableBackSide backSide)
  • Method Details

    • getKingdom

      public Optional<ResourceType> getKingdom()
    • getPlayedSideType

      public Optional<CardSideType> getPlayedSideType()
    • getSides

      public List<PlayableSide> getSides()
      A [front, back] list of sides
    • getSide

      public PlayableSide getSide(CardSideType sideType)
      Gets the desired side of the card
      Parameters:
      sideType - The type of the side to get
    • getPlayedSide

      public Optional<PlayableSide> getPlayedSide()
      Gets the currently played side, if any
    • getBackPermanentResources

      public List<ResourceType> getBackPermanentResources()
      Returns:
      the card's backPermanentResources
    • setPlayedSideType

      public void setPlayedSideType(CardSideType playedSideType)
      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

      public Function<PlayerBoard,Integer> 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 class Card
    • cardToAscii

      public String cardToAscii(HashMap<Integer,String> cardStringMap)
      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

      public String cardToString()