Module it.polimi.ingsw.am13
Class ViewGUIControllerJoinedRoom
java.lang.Object
it.polimi.ingsw.am13.client.view.gui.ViewGUIController
it.polimi.ingsw.am13.client.view.gui.ViewGUIControllerJoinedRoom
Controller of 'JoinedRoom' scene, where player can wait for the room to get full or can leave the room
-
Field Summary
FieldsModifier and TypeFieldDescriptionjavafx.scene.control.TableColumn
<PlayerLobby, String> javafx.scene.control.TableView
<PlayerLobby> private int
Counter for the number of players currently in roomprivate javafx.scene.control.Label
private RoomIF
The room this client belongs toFields inherited from class it.polimi.ingsw.am13.client.view.gui.ViewGUIController
networkHandler, scene, stage
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
Force closing the app.void
Leave the room when the player clicks on the corresponding buttonvoid
setGameState
(GameState state) Method that sets the gameStatevoid
Sets this room and then callsupdateRoomLabel()
void
setThisPlayer
(PlayerLobby player) Method that sets the playervoid
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)void
showPlayerDisconnected
(PlayerLobby player) This method cannot be calledvoid
showPlayerJoinedRoom
(PlayerLobby player) Shows that a player joined the room by adding it to thejoinedRoomTable
and then callingupdateRoomLabel()
void
showPlayerReconnected
(PlayerLobby player) It shows that a player reconnected to an ongoing game by calling the corresponding method onViewGUIController
.void
Initialises thejoinedRoomTable
private void
Update the label of this roomMethods inherited from class it.polimi.ingsw.am13.client.view.gui.ViewGUIController
getScene, setNetworkHandler, setScene, setStage, switchToScene
-
Field Details
-
joinedRoomPlayersColumn
-
joinedRoomTable
-
roomLabel
private javafx.scene.control.Label roomLabel -
thisRoom
The room this client belongs to -
playerCount
private int playerCountCounter for the number of players currently in room
-
-
Constructor Details
-
ViewGUIControllerJoinedRoom
public ViewGUIControllerJoinedRoom()
-
-
Method Details
-
setThisPlayer
Method that sets the player- Specified by:
setThisPlayer
in classViewGUIController
- Parameters:
player
- the player associated to thisViewGUIController
-
setGameState
Method that sets the gameState- Specified by:
setGameState
in classViewGUIController
- Parameters:
state
- the representation of the state of the game
-
getSceneTitle
- Specified by:
getSceneTitle
in classViewGUIController
- Returns:
- the title of the scene
-
showException
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 classViewGUIController
- Parameters:
e
- Exception to be shown
-
showPlayerDisconnected
This method cannot be called- Specified by:
showPlayerDisconnected
in classViewGUIController
- Parameters:
player
- Player who disconnected
-
showPlayerReconnected
It shows that a player reconnected to an ongoing game by calling the corresponding method onViewGUIController
.- Specified by:
showPlayerReconnected
in classViewGUIController
- 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 classViewGUIController
-
updateRoomLabel
private void updateRoomLabel()Update the label of this room -
setRoom
Sets this room and then callsupdateRoomLabel()
- Parameters:
room
- the room this client belongs to
-
showPlayerJoinedRoom
Shows that a player joined the room by adding it to thejoinedRoomTable
and then callingupdateRoomLabel()
- Parameters:
player
- who joined the room
-
showRooms
Initialises thejoinedRoomTable
- Parameters:
rooms
- list of the existing rooms
-
onLeaveRoomClick
public void onLeaveRoomClick()Leave the room when the player clicks on the corresponding button
-