Class ChooseLeaderOnWhiteMarbleAction
java.lang.Object
it.polimi.ingsw.controller.action.Action
it.polimi.ingsw.controller.action.ChooseLeaderOnWhiteMarbleAction
public class ChooseLeaderOnWhiteMarbleAction extends Action
An action used to specify which leader card must be used to convert a white marble
-
Constructor Summary
Constructors Constructor Description ChooseLeaderOnWhiteMarbleAction(int leaderIndex)ChooseLeaderOnWhiteMarbleAction(java.lang.String username, int leaderIndex) -
Method Summary
Modifier and Type Method Description PhaseTypeperformAction(IGameState gameState)Add a white marble of the specified player using the specified leader card to convert it.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
-
ChooseLeaderOnWhiteMarbleAction
public ChooseLeaderOnWhiteMarbleAction(int leaderIndex) -
ChooseLeaderOnWhiteMarbleAction
public ChooseLeaderOnWhiteMarbleAction(java.lang.String username, int leaderIndex)
-
-
Method Details
-
performAction
public PhaseType performAction(IGameState gameState) throws InvalidActionException, NotAllowedActionException, WrongPlayerException, InvalidUsernameException, InvalidLeaderCardExceptionAdd a white marble of the specified player using the specified leader card to convert it.- 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 gameInvalidLeaderCardException- the specified leader card doesn't exist
-