Class Farmer
java.lang.Object
it.polimi.ingsw.eriantys.model.characters.BaseCharacterCard
it.polimi.ingsw.eriantys.model.characters.Farmer
- All Implemented Interfaces:
CharacterCard
Represents the "farmer" character card and the corresponding effect.
- See Also:
-
Constructor Summary
ConstructorDescriptionFarmer
(ProfessorOwnership professorOwnership) Constructs a newFarmer
character card. -
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.Methods inherited from class it.polimi.ingsw.eriantys.model.characters.BaseCharacterCard
getCost, increaseCost, setupEffect
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
-
Farmer
Constructs a newFarmer
character card.- Parameters:
professorOwnership
- Reference to theProfessorOwnership
object for the current game.
-
-
Method Details
-
applyEffect
public void applyEffect(List<Color> sourceColors, List<Color> destinationColors, Color targetColor, IslandGroup targetIsland) 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
-
cancelEffect
public void cancelEffect()Description copied from interface:CharacterCard
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.- Specified by:
cancelEffect
in interfaceCharacterCard
- Overrides:
cancelEffect
in classBaseCharacterCard
-