Module it.polimi.ingsw.am13
Class MenuItemPlayCard
java.lang.Object
it.polimi.ingsw.am13.client.view.tui.menu.MenuItem
it.polimi.ingsw.am13.client.view.tui.menu.MenuItemPlayCard
Menu item for playing a card on field during a turn-based game phase.
It expects 3 arguments:
- Number of card to play (index of the card in the list of hand cards in game's state
- Number of spot where to place the card in field (index of the coordinates in the list of available coordinates for that field in game's state
- Side on which to play the card (front / back)
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionMenuItemPlayCard
(GameState state) Build a new item for playing a card on field -
Method Summary
Modifier and TypeMethodDescriptionvoid
executeCommand
(String argsStr, NetworkHandler networkHandler) Executes the action this menu item representsMethods inherited from class it.polimi.ingsw.am13.client.view.tui.menu.MenuItem
getCommandKey, getDescription, toString
-
Field Details
-
state
Reference to the current game's state
-
-
Constructor Details
-
MenuItemPlayCard
Build a new item for playing a card on field- Parameters:
state
- Reference to the current game's state
-
-
Method Details
-
executeCommand
public void executeCommand(String argsStr, NetworkHandler networkHandler) throws InvalidTUICommandException Executes the action this menu item represents- Specified by:
executeCommand
in classMenuItem
- Parameters:
argsStr
- String of parameters for the commandnetworkHandler
- Handler of the network thanks to which the item sends the command to the server- Throws:
InvalidTUICommandException
- If the arguments passed via command line are wrong, or anyway different from what expected
-