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
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidResets the effects of this card that are not intended to persist after the activation turn.intgetCost()A getter for the amount of coins needed to activate the effect of this card.protected voidvoidPrepares this card to be activated.Methods 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
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:CharacterCardA getter for the amount of coins needed to activate the effect of this card.- Specified by:
getCostin interfaceCharacterCard- Returns:
- the cost of the card
-
increaseCost
protected void increaseCost() -
setupEffect
Description copied from interface:CharacterCardPrepares this card to be activated. It should be called once at the beginning of the game.- Specified by:
setupEffectin interfaceCharacterCard- Throws:
InvalidArgumentException- if (eventual) 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- Throws:
InvalidArgumentException- if one or more (eventual) parameters needed for the call are illegal
-