Class BaseCharacterCard
java.lang.Object
it.polimi.ingsw.eriantys.model.characters.BaseCharacterCard
- All Implemented Interfaces:
CharacterCard
- Direct Known Subclasses:
Farmer
,Herald
,HerbGranny
,InfluenceCharacterCard
,MagicPostman
,Minstrel
,Thief
Abstract class that represents character cards that don't hold students.
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
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.protected void
void
Prepares this card to be activated.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
applyEffect, getName
-
Constructor Details
-
BaseCharacterCard
public BaseCharacterCard(int initialCost) Constructs the character card.- Parameters:
initialCost
- Initial cost to activate the effect.
-
-
Method Details
-
getCost
public int getCost()Description copied from interface:CharacterCard
A getter for the amount of coins needed to activate the effect of this card.- Specified by:
getCost
in interfaceCharacterCard
- Returns:
- the cost of the card
-
increaseCost
protected void increaseCost() -
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
- Throws:
InvalidArgumentException
- if (eventual) parameters are illegal
-
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
- Throws:
InvalidArgumentException
- if one or more (eventual) parameters needed for the call are illegal
-