Class ChooseInitialResourcesAction
java.lang.Object
it.polimi.ingsw.controller.action.Action
it.polimi.ingsw.controller.action.ChooseInitialResourcesAction
public class ChooseInitialResourcesAction extends Action
An action to specify the initial resources of a player
-
Constructor Summary
Constructors Constructor Description ChooseInitialResourcesAction(java.lang.String username, java.util.Map<ResourceType,java.lang.Integer> resources)ChooseInitialResourcesAction(java.util.Map<ResourceType,java.lang.Integer> resources) -
Method Summary
Modifier and Type Method Description PhaseTypeperformAction(IGameState gameState)Assign the specified initial resources to the 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
-
ChooseInitialResourcesAction
-
ChooseInitialResourcesAction
public ChooseInitialResourcesAction(java.lang.String username, java.util.Map<ResourceType,java.lang.Integer> resources)
-
-
Method Details
-
performAction
public PhaseType performAction(IGameState gameState) throws InvalidActionException, NotAllowedActionException, WrongPlayerException, InvalidUsernameException, NegativeQuantityException, WrongResourceNumberException, AbuseOfFaithException, NotEnoughSpaceExceptionAssign the specified initial resources to the 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 gameNegativeQuantityException- at least one quantity of the specified resources is negativeWrongResourceNumberException- the number of the specified resources and the number of resources that belong to the player are differentAbuseOfFaithException- one of the specified resources is faithNotEnoughSpaceException- the player has not enough space to contain these resources
-