Class ContainerCharacterCard
java.lang.Object
it.polimi.ingsw.eriantys.model.StudentContainer
it.polimi.ingsw.eriantys.model.characters.ContainerCharacterCard
- All Implemented Interfaces:
CharacterCard
- Direct Known Subclasses:
Jester,Monk,SpoiledPrincess
Abstract class that represents the character cards that require to contain students to use when activating the effect.
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionContainerCharacterCard(int maxSize, int initialCost, Bag bag) Constructs the character card. -
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 it.polimi.ingsw.eriantys.model.StudentContainer
empty, fill, getQuantity, getRepresentation, moveAllTo, moveTo, moveTo, refillFrom, remainingCapacity, swapMethods 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
-
Field Details
-
bag
Reference to theBagfrom which to draw the students.
-
-
Constructor Details
-
ContainerCharacterCard
Constructs the character card.- Parameters:
maxSize- Maximum number of students on this card.initialCost- Initial cost to activate the effect.bag- Reference to theBagobject for the current game.
-
-
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 illegalNoMovementException- if students couldn't be moved correctly
-
cancelEffect
public void 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
-