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 TypeMethodDescriptionvoid
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
getCost()
A getter for the amount of coins needed to activate the effect of this card.default String
getName()
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
Prepares this card to be activated. It should be called once at the beginning of the game.- Throws:
InvalidArgumentException
- if (eventual) parameters are illegalNoMovementException
- 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 sourcedestinationColors
- a list of student colors selected from the destinationtargetColor
- the color selected for the effecttargetIsland
- the island selected for the effect- Throws:
NoMovementException
- if an error occurs while wielding student related movements and swapsItemNotAvailableException
- if an error occurs while wielding a game itemDuplicateNoEntryTileException
- if an error occurs while wielding no-entry tilesInvalidArgumentException
- if one or more parameters are illegal
-
cancelEffect
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
A getter for the name of the class, representing the character name.- Returns:
- the simple name of the card
-