Class HerbGranny
java.lang.Object
it.polimi.ingsw.eriantys.model.characters.BaseCharacterCard
it.polimi.ingsw.eriantys.model.characters.HerbGranny
- All Implemented Interfaces:
CharacterCard
Represents the "herb granny" character card and the corresponding effect.
- See Also:
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidapplyEffect(List<Color> sourceColors, List<Color> destinationColors, Color targetColor, IslandGroup targetIsland) Activates this card and applies the effect.A helper-getter method to fulfill theBoardStatuscreation process.voidreturnTile(int id) Method called when a no-entry tile is removed from an island to put it back on this card.voidPrepares this card to be activated.Methods inherited from class it.polimi.ingsw.eriantys.model.characters.BaseCharacterCard
cancelEffect, getCost, increaseCostMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface it.polimi.ingsw.eriantys.model.characters.CharacterCard
getName
-
Constructor Details
-
HerbGranny
Constructs a newHerbGrannycharacter card.- Parameters:
board- Reference to theBoardobject for the current game.
-
-
Method Details
-
returnTile
public void returnTile(int id) Method called when a no-entry tile is removed from an island to put it back on this card.- Parameters:
id- ID of the tile to put back.- See Also:
-
setupEffect
Description copied from interface:CharacterCardPrepares this card to be activated. It should be called once at the beginning of the game.- Specified by:
setupEffectin interfaceCharacterCard- Overrides:
setupEffectin classBaseCharacterCard- Throws:
InvalidArgumentException- if (eventual) parameters are illegal
-
applyEffect
public void applyEffect(List<Color> sourceColors, List<Color> destinationColors, Color targetColor, IslandGroup targetIsland) throws DuplicateNoEntryTileException, InvalidArgumentException, ItemNotAvailableException Description copied from interface:CharacterCardActivates 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 sourcedestinationColors- a list of student colors selected from the destinationtargetColor- the color selected for the effecttargetIsland- the island selected for the effect- Throws:
DuplicateNoEntryTileException- if an error occurs while wielding no-entry tilesInvalidArgumentException- if one or more parameters are illegalItemNotAvailableException- if an error occurs while wielding a game item
-
getNoEntryTiles
A helper-getter method to fulfill theBoardStatuscreation process.- Returns:
- a representation for the number of no-entry tiles placed on the card
-