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
-
Constructor Summary
ConstructorDescriptionContainerCharacterCard
(int maxSize, int initialCost, Bag bag) Constructs the character card. -
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 it.polimi.ingsw.eriantys.model.StudentContainer
empty, fill, getQuantity, getRepresentation, moveAllTo, moveTo, moveTo, refillFrom, remainingCapacity, swap
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
-
Field Details
-
bag
Reference to theBag
from 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 theBag
object for the current game.
-
-
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 illegalNoMovementException
- if students couldn't be moved correctly
-
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
-