Class ViewGUIControllerJoinedRoom

java.lang.Object
it.polimi.ingsw.am13.client.view.gui.ViewGUIController
it.polimi.ingsw.am13.client.view.gui.ViewGUIControllerJoinedRoom

public class ViewGUIControllerJoinedRoom extends ViewGUIController
Controller of 'JoinedRoom' scene, where player can wait for the room to get full or can leave the room
  • Field Details

    • joinedRoomPlayersColumn

      public javafx.scene.control.TableColumn<PlayerLobby,String> joinedRoomPlayersColumn
    • joinedRoomTable

      public javafx.scene.control.TableView<PlayerLobby> joinedRoomTable
    • roomLabel

      private javafx.scene.control.Label roomLabel
    • thisRoom

      private RoomIF thisRoom
      The room this client belongs to
    • playerCount

      private int playerCount
      Counter for the number of players currently in room
  • Constructor Details

    • ViewGUIControllerJoinedRoom

      public ViewGUIControllerJoinedRoom()
  • Method Details

    • setThisPlayer

      public void setThisPlayer(PlayerLobby player)
      Method that sets the player
      Specified by:
      setThisPlayer in class ViewGUIController
      Parameters:
      player - the player associated to this ViewGUIController
    • setGameState

      public void setGameState(GameState state)
      Method that sets the gameState
      Specified by:
      setGameState in class ViewGUIController
      Parameters:
      state - the representation of the state of the game
    • getSceneTitle

      public String getSceneTitle()
      Specified by:
      getSceneTitle in class ViewGUIController
      Returns:
      the title of the scene
    • showException

      public void showException(Exception e)
      Description copied from class: ViewGUIController
      Shows a generic exception in the view (specific exception could be handled in different ways, also depending on the phase or the state of game)
      Specified by:
      showException in class ViewGUIController
      Parameters:
      e - Exception to be shown
    • showPlayerDisconnected

      public void showPlayerDisconnected(PlayerLobby player)
      This method cannot be called
      Specified by:
      showPlayerDisconnected in class ViewGUIController
      Parameters:
      player - Player who disconnected
    • showPlayerReconnected

      public void showPlayerReconnected(PlayerLobby player)
      It shows that a player reconnected to an ongoing game by calling the corresponding method on ViewGUIController.
      Specified by:
      showPlayerReconnected in class ViewGUIController
      Parameters:
      player - Player who reconnected
    • forceCloseApp

      public void forceCloseApp()
      Force closing the app. It should be used to end the app for anomalous reasons
      Specified by:
      forceCloseApp in class ViewGUIController
    • updateRoomLabel

      private void updateRoomLabel()
      Update the label of this room
    • setRoom

      public void setRoom(RoomIF room)
      Sets this room and then calls updateRoomLabel()
      Parameters:
      room - the room this client belongs to
    • showPlayerJoinedRoom

      public void showPlayerJoinedRoom(PlayerLobby player)
      Shows that a player joined the room by adding it to the joinedRoomTable and then calling updateRoomLabel()
      Parameters:
      player - who joined the room
    • showRooms

      public void showRooms(List<RoomIF> rooms)
      Initialises the joinedRoomTable
      Parameters:
      rooms - list of the existing rooms
    • onLeaveRoomClick

      public void onLeaveRoomClick()
      Leave the room when the player clicks on the corresponding button