Class ContainerCharacterCard

java.lang.Object
it.polimi.ingsw.eriantys.model.StudentContainer
it.polimi.ingsw.eriantys.model.characters.ContainerCharacterCard
All Implemented Interfaces:
CharacterCard
Direct Known Subclasses:
Jester, Monk, SpoiledPrincess

public abstract class ContainerCharacterCard extends StudentContainer implements CharacterCard
Abstract class that represents the character cards that require to contain students to use when activating the effect.
  • Field Details

    • bag

      protected final Bag bag
      Reference to the Bag from which to draw the students.
  • Constructor Details

    • ContainerCharacterCard

      public ContainerCharacterCard(int maxSize, int initialCost, Bag bag)
      Constructs the character card.
      Parameters:
      maxSize - Maximum number of students on this card.
      initialCost - Initial cost to activate the effect.
      bag - Reference to the Bag object for the current game.
  • 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, NoMovementException
      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
      NoMovementException - if students couldn't be moved correctly
    • cancelEffect

      public void cancelEffect()
      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