Class MenuItemPickCard

java.lang.Object
it.polimi.ingsw.am13.client.view.tui.menu.MenuItem
it.polimi.ingsw.am13.client.view.tui.menu.MenuItemPickCard

public class MenuItemPickCard extends MenuItem
Menu item for picking a card off the common field during a turn-based game phase. It expects 2:
  • Type of card to pick (res / gold)
  • What card of that type to pick (draw for drawing from the deck, 1 or 2 to pick the first or the second visible card starting from left)
And then it sends the command to the server
  • Field Details

    • state

      private final GameState state
      Reference to the current game's state
  • Constructor Details

    • MenuItemPickCard

      public MenuItemPickCard(GameState state)
      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 class MenuItem
      Parameters:
      argsStr - String of parameters for the command
      networkHandler - 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