Added some documentation where it was appropriate.
Positively knackered - what ever happens: I'm out for the Day
This commit is contained in:
parent
26b9243df2
commit
4ba87a91a3
@ -65,11 +65,19 @@ public class ChatApp extends Application {
|
||||
this.gameC = gameC;
|
||||
}
|
||||
|
||||
/**
|
||||
* are u sure this is the field you want to get?
|
||||
* @param lSVController a LoungeSceneViewController
|
||||
*/
|
||||
public void setlSVController(
|
||||
LoungeSceneViewController lSVController) {
|
||||
this.lSVController = lSVController;
|
||||
}
|
||||
|
||||
/**
|
||||
* are u sure this is the field you want to get?
|
||||
* @return the clientModel of this chatApp
|
||||
*/
|
||||
public ClientModel getcModel() {
|
||||
return cModel;
|
||||
}
|
||||
@ -79,6 +87,10 @@ public class ChatApp extends Application {
|
||||
ChatApp.gameController = gameController;
|
||||
}
|
||||
|
||||
/**
|
||||
* needs to be called, if the gameController needs to be accessed from outside the application thread
|
||||
* @return the relevant GameController
|
||||
*/
|
||||
public GameController getGameController() {
|
||||
return gameController;
|
||||
}
|
||||
@ -95,18 +107,31 @@ public class ChatApp extends Application {
|
||||
return clientModel;
|
||||
}
|
||||
|
||||
/**
|
||||
* needs to be called, if the chatController needs to be accessed from outside the application thread
|
||||
* @return the relevant ChatController
|
||||
*/
|
||||
public ChatController getChatController() {
|
||||
return chatController;
|
||||
}
|
||||
|
||||
/**
|
||||
* needs to be called, if the LoungeSceneViewController needs to be accessed from outside the application thread
|
||||
* @return the relevant LoungeSceneViewController
|
||||
*/
|
||||
public LoungeSceneViewController getLoungeSceneViewController() {
|
||||
return loungeSceneViewController;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sure this is the field u want? not the static one?
|
||||
* @return a LoungeSceneViewController
|
||||
*/
|
||||
public LoungeSceneViewController getlSVController() {
|
||||
return lSVController;
|
||||
}
|
||||
|
||||
|
||||
public static void setLoungeSceneViewController(LoungeSceneViewController controller) {
|
||||
loungeSceneViewController = controller;
|
||||
}
|
||||
|
||||
@ -236,6 +236,7 @@ public class GameController implements Initializable {
|
||||
|
||||
/**
|
||||
* Updates the labels of the rooms accordingly to the datastructures in GameStateModel
|
||||
* TODO(Seraina): use a method to shorten, its madness
|
||||
*/
|
||||
public void updateRoomLabels() {
|
||||
LOGGER.debug("roomlables update");
|
||||
@ -338,6 +339,10 @@ public class GameController implements Initializable {
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* loads the notification Bell from resource
|
||||
* @return the Image node containing the BellImage
|
||||
*/
|
||||
public Image loadBellImage() {
|
||||
Image bell = new Image("ch/unibas/dmi/dbis/cs108/multiplayer/client/gui/game/DayOpen/bell.png");
|
||||
return bell;
|
||||
|
||||
@ -312,6 +312,9 @@ public class LoungeSceneViewController implements Initializable {
|
||||
LobbyListView.setVisible(true);
|
||||
}
|
||||
|
||||
/**
|
||||
* Adds the gameView to the existing LobbyView
|
||||
*/
|
||||
public void addGameView() {
|
||||
Platform.runLater(new Runnable() {
|
||||
@Override
|
||||
@ -327,6 +330,9 @@ public class LoungeSceneViewController implements Initializable {
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Removes the GameView again - needed when a game is over or a lobby is left
|
||||
*/
|
||||
public void removeGameView() {
|
||||
Platform.runLater(new Runnable() {
|
||||
@Override
|
||||
@ -342,6 +348,9 @@ public class LoungeSceneViewController implements Initializable {
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Adds the ChatView to the LobbyView, should be done right in the initialisation
|
||||
*/
|
||||
public void addChatView() {
|
||||
Platform.runLater(new Runnable() {
|
||||
@Override
|
||||
@ -419,20 +428,33 @@ public class LoungeSceneViewController implements Initializable {
|
||||
LOGGER.debug("In newLobby()3 LobbyListView" + LobbyListView);
|
||||
}
|
||||
|
||||
/**
|
||||
* Send the joinLobby Protocol message
|
||||
* @param lobbyID the Lobby to be joinded
|
||||
*/
|
||||
public void joinGame(String lobbyID) {
|
||||
client.getClient().sendMsgToServer(Protocol.joinLobby + "$" + lobbyID);
|
||||
}
|
||||
|
||||
/**
|
||||
* Sends the startNewGame Protocol message
|
||||
*/
|
||||
public void startGame() {
|
||||
client.getClient().sendMsgToServer(Protocol.startANewGame);
|
||||
//addGameView();
|
||||
}
|
||||
|
||||
/**
|
||||
* Sends the leaveLobby protocol message
|
||||
*/
|
||||
public void leaveLobby() {
|
||||
client.getClient().sendMsgToServer(Protocol.leaveLobby);
|
||||
removeGameView();
|
||||
}
|
||||
|
||||
/**
|
||||
* Sends the Quit protocol message
|
||||
*/
|
||||
public void leaveServer() {
|
||||
client.getClient().sendMsgToServer(Protocol.clientQuitRequest);
|
||||
}
|
||||
@ -456,6 +478,10 @@ public class LoungeSceneViewController implements Initializable {
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Sould remove a client of a certain name from the ListView
|
||||
* @param name the name of the client to be removed
|
||||
*/
|
||||
public void removeClientFromList(String name){
|
||||
Iterator<ClientListItem> it = clients.iterator();
|
||||
while (it.hasNext()) {
|
||||
@ -470,11 +496,16 @@ public class LoungeSceneViewController implements Initializable {
|
||||
//todo
|
||||
}
|
||||
|
||||
/**
|
||||
* Sends the create New Lobby Protocol message
|
||||
*/
|
||||
public void newGame() {
|
||||
client.getClient().sendMsgToServer(Protocol.createNewLobby);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Sends the nameChange command, taking the new Name from the TextFlied
|
||||
*/
|
||||
public void changeName() {
|
||||
TextField name = new TextField();
|
||||
name.setPromptText("Enter new Nickname!");
|
||||
@ -497,10 +528,16 @@ public class LoungeSceneViewController implements Initializable {
|
||||
LoungeSceneViewController.client = client;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sends the highScore request message
|
||||
*/
|
||||
public void sendHIghScore() {
|
||||
client.getClient().sendMsgToServer(Protocol.highScoreList);
|
||||
}
|
||||
|
||||
/**
|
||||
* Sends the listLobbies protocol message
|
||||
*/
|
||||
public void sendLilstle() {
|
||||
client.getClient().sendMsgToServer(Protocol.listLobbies);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user