Interface CharacterCard

All Known Implementing Classes:
BaseCharacterCard, Centaur, ContainerCharacterCard, Farmer, Herald, HerbGranny, InfluenceCharacterCard, Jester, Knight, MagicPostman, Minstrel, Monk, MushroomGuy, SpoiledPrincess, Thief

public interface CharacterCard
The CharacterCard class is used to handle character effects in expert mode games.
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    applyEffect(List<Color> sourceColors, List<Color> destinationColors, Color targetColor, IslandGroup targetIsland)
    Activates this card and applies the effect.
    void
    Resets the effects of this card that are not intended to persist after the activation turn.
    int
    A getter for the amount of coins needed to activate the effect of this card.
    default String
    A getter for the name of the class, representing the character name.
    void
    Prepares this card to be activated.
  • Method Details

    • getCost

      int getCost()
      A getter for the amount of coins needed to activate the effect of this card.
      Returns:
      the cost of the card
    • setupEffect

      void setupEffect() throws InvalidArgumentException, NoMovementException
      Prepares this card to be activated. It should be called once at the beginning of the game.
      Throws:
      InvalidArgumentException - if (eventual) parameters are illegal
      NoMovementException - if students couldn't be moved correctly
    • applyEffect

      void applyEffect(List<Color> sourceColors, List<Color> destinationColors, Color targetColor, IslandGroup targetIsland) throws DuplicateNoEntryTileException, InvalidArgumentException, ItemNotAvailableException, NoMovementException
      Activates this card and applies the effect. If it is the first time also increases the cost for next activations. Only some arguments might be used for a specific character card effect.
      Parameters:
      sourceColors - a list of student colors selected from the source
      destinationColors - a list of student colors selected from the destination
      targetColor - the color selected for the effect
      targetIsland - the island selected for the effect
      Throws:
      NoMovementException - if an error occurs while wielding student related movements and swaps
      ItemNotAvailableException - if an error occurs while wielding a game item
      DuplicateNoEntryTileException - if an error occurs while wielding no-entry tiles
      InvalidArgumentException - if one or more parameters are illegal
    • cancelEffect

      void cancelEffect() throws InvalidArgumentException
      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.
      Throws:
      InvalidArgumentException - if one or more (eventual) parameters needed for the call are illegal
    • getName

      default String getName()
      A getter for the name of the class, representing the character name.
      Returns:
      the simple name of the card