Package it.polimi.ingsw.model.leadercard
Class LeaderProduceBehaviour
java.lang.Object
it.polimi.ingsw.model.leadercard.CardBehaviour
it.polimi.ingsw.model.leadercard.LeaderProduceBehaviour
public class LeaderProduceBehaviour extends CardBehaviour
The CardBehaviour that represents the producing behaviour: a leader card with this behaviour can perform a production
-
Constructor Summary
Constructors Constructor Description LeaderProduceBehaviour(ResourceType resourceToRemove) -
Method Summary
Modifier and Type Method Description ResourceTypegetProductionRequirement()voidproduce(ResourceType resourceToAdd, InterfacePlayerBoard playerBoard)activates the leader ability to produce resources.Methods inherited from class it.polimi.ingsw.model.leadercard.CardBehaviour
createStorage, discount, getOnWhite, getResourceToDiscount, getResToStoreMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Constructor Details
-
LeaderProduceBehaviour
-
-
Method Details
-
produce
public void produce(ResourceType resourceToAdd, InterfacePlayerBoard playerBoard) throws AbuseOfFaithException, NotEnoughResourcesException, NeedAResourceToAddExceptionDescription copied from class:CardBehaviouractivates the leader ability to produce resources. Does nothing if the card doesn't have this ability- Overrides:
producein classCardBehaviour- Parameters:
resourceToAdd- the resource to add to the ChestplayerBoard- the playerBoard in which to add the resources- Throws:
AbuseOfFaithException- if resourceToAdd is the faith resourceNotEnoughResourcesException- if the specified playerBoard doesn't have enough resources to consume for the productionNeedAResourceToAddException- if the resourceToAdd parameter is not specified
-
getProductionRequirement
- Overrides:
getProductionRequirementin classCardBehaviour
-