Class BaseProductionAction
java.lang.Object
it.polimi.ingsw.controller.action.Action
it.polimi.ingsw.controller.action.BaseProductionAction
public class BaseProductionAction extends Action
An action to request to the model to activate the base player board production of a specific player
-
Constructor Summary
Constructors Constructor Description BaseProductionAction(ResourceType resource1, ResourceType resource2, ResourceType product)BaseProductionAction(java.lang.String username, ResourceType resource1, ResourceType resource2, ResourceType product) -
Method Summary
Modifier and Type Method Description PhaseTypeperformAction(IGameState gameState)Perform the player board's base production of the specified player.Methods inherited from class it.polimi.ingsw.controller.action.Action
getUsername, isCurrentPlayer, setUsernameMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Constructor Details
-
BaseProductionAction
-
BaseProductionAction
public BaseProductionAction(java.lang.String username, ResourceType resource1, ResourceType resource2, ResourceType product)
-
-
Method Details
-
performAction
public PhaseType performAction(IGameState gameState) throws InvalidActionException, NotAllowedActionException, WrongPlayerException, InvalidUsernameException, AlreadyProducedException, NotEnoughResourcesException, AbuseOfFaithExceptionPerform the player board's base production of the specified player.- Specified by:
performActionin classAction- Parameters:
gameState- the current state of this game- Returns:
- the next phase of this player's turn
- Throws:
InvalidActionException- this Action is not correctly initializedNotAllowedActionException- this Action can't be performed in this phase of turn or gameWrongPlayerException- the player for which this action must be performed isn't the current playerInvalidUsernameException- the player for which this action must be performed doesn't exist in this gameAlreadyProducedException- the base production has already been performed in this turnNotEnoughResourcesException- the player doesn't have the specified resources to consumeAbuseOfFaithException- faith can't be consumed or produced in a base production
-