Class InfluenceCharacterCard
java.lang.Object
it.polimi.ingsw.eriantys.model.characters.BaseCharacterCard
it.polimi.ingsw.eriantys.model.characters.InfluenceCharacterCard
- All Implemented Interfaces:
CharacterCard
- Direct Known Subclasses:
Centaur,Knight,MushroomGuy
Abstract class that represents character cards which effects alter influence calculations.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected InfluenceCalculatorInfluenceCalculatorto set when the effect is activated.protected final GameManagerReference to theGameManagerobject for the current game. -
Constructor Summary
ConstructorsConstructorDescriptionInfluenceCharacterCard(int initialCost, GameManager gameManager) Constructs the character card. -
Method Summary
Modifier and TypeMethodDescriptionvoidapplyEffect(List<Color> sourceColors, List<Color> destinationColors, Color targetColor, IslandGroup targetIsland) Activates this card and applies the effect.voidResets the effects of this card that are not intended to persist after the activation turn.Methods inherited from class it.polimi.ingsw.eriantys.model.characters.BaseCharacterCard
getCost, increaseCost, setupEffectMethods 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
-
Field Details
-
effectInfluenceCalculator
InfluenceCalculatorto set when the effect is activated. -
gameManager
Reference to theGameManagerobject for the current game.
-
-
Constructor Details
-
InfluenceCharacterCard
Constructs the character card.- Parameters:
initialCost- Initial cost to activate the effect.gameManager- Reference to theGameManagerobject for the current game.
-
-
Method Details
-
applyEffect
public void applyEffect(List<Color> sourceColors, List<Color> destinationColors, Color targetColor, IslandGroup targetIsland) throws InvalidArgumentException 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:
InvalidArgumentException- if one or more parameters are illegal
-
cancelEffect
Description copied from interface:CharacterCardResets 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:
cancelEffectin interfaceCharacterCard- Overrides:
cancelEffectin classBaseCharacterCard- Throws:
InvalidArgumentException- if one or more (eventual) parameters needed for the call are illegal
-