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
-
Method Summary
Modifier and TypeMethodDescriptionvoid
applyEffect
(List<Color> sourceColors, List<Color> destinationColors, Color targetColor, IslandGroup targetIsland) Activates this card and applies the effect.A helper-getter method to fulfill theBoardStatus
creation process.void
returnTile
(int id) Method called when a no-entry tile is removed from an island to put it back on this card.void
Prepares this card to be activated.Methods inherited from class it.polimi.ingsw.eriantys.model.characters.BaseCharacterCard
cancelEffect, getCost, increaseCost
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface it.polimi.ingsw.eriantys.model.characters.CharacterCard
getName
-
Constructor Details
-
HerbGranny
Constructs a newHerbGranny
character card.- Parameters:
board
- Reference to theBoard
object 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:CharacterCard
Prepares this card to be activated. It should be called once at the beginning of the game.- Specified by:
setupEffect
in interfaceCharacterCard
- Overrides:
setupEffect
in 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:CharacterCard
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 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 theBoardStatus
creation process.- Returns:
- a representation for the number of no-entry tiles placed on the card
-