Class BaseCharacterCard

java.lang.Object
it.polimi.ingsw.eriantys.model.characters.BaseCharacterCard
All Implemented Interfaces:
CharacterCard
Direct Known Subclasses:
Farmer, Herald, HerbGranny, InfluenceCharacterCard, MagicPostman, Minstrel, Thief

public abstract class BaseCharacterCard extends Object implements CharacterCard
Abstract class that represents character cards that don't hold students.
  • Constructor Details

    • BaseCharacterCard

      public BaseCharacterCard(int initialCost)
      Constructs the character card.
      Parameters:
      initialCost - Initial cost to activate the effect.
  • Method Details

    • getCost

      public int getCost()
      Description copied from interface: CharacterCard
      A getter for the amount of coins needed to activate the effect of this card.
      Specified by:
      getCost in interface CharacterCard
      Returns:
      the cost of the card
    • increaseCost

      protected void increaseCost()
    • setupEffect

      public void setupEffect() throws InvalidArgumentException
      Description copied from interface: CharacterCard
      Prepares this card to be activated. It should be called once at the beginning of the game.
      Specified by:
      setupEffect in interface CharacterCard
      Throws:
      InvalidArgumentException - if (eventual) parameters are illegal
    • cancelEffect

      public void cancelEffect() throws InvalidArgumentException
      Description copied from interface: CharacterCard
      Resets the effects of this card that are not intended to persist after the activation turn. It should be called at the end of the turn.
      Specified by:
      cancelEffect in interface CharacterCard
      Throws:
      InvalidArgumentException - if one or more (eventual) parameters needed for the call are illegal