Class MenuItemCreateRoom

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

public class MenuItemCreateRoom extends MenuItem
Menu item for creating a room. It parses the parameters as:
  • Nickname (1 word)
  • Color of token (red / blue / green / yellow)
  • Number of players to make the game start
It then sends to the server the command for creating a new room
  • Constructor Details

    • MenuItemCreateRoom

      public MenuItemCreateRoom()
      Build a new item for creating a new room
  • Method Details

    • executeCommand

      public void executeCommand(String args, NetworkHandler networkHandler) throws InvalidTUICommandException
      Description copied from class: MenuItem
      Executes the action this menu item represents
      Specified by:
      executeCommand in class MenuItem
      Parameters:
      args - 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