コード例 #1
0
 /**
  * This method informs the ChatPanel and ServerSettings classes of the player's name, so it can be
  * displayed in the appropriate places.
  */
 public void setName(String localName) {
   playerName = localName;
   chatPanel.setName(playerName);
   serverSettings.setName(playerName);
 }
コード例 #2
0
 /**
  * This method changes all of the GUI components depending on whether the player is connected to a
  * server, because different functionality is needed when we're connected from when we're not.
  */
 public void toggleGUIStates(boolean gameRunning) {
   serverSettings.flipButtonStates(gameRunning);
   chatPanel.setConnected(gameRunning);
   dungeonPanelOverlay.toggleGameStarted(gameRunning);
   dungeonPanel.setVisible(gameRunning);
 }