- Added documentation to controllers

tags : #story[1245]
This commit is contained in:
Alistair McIntyre
2017-09-12 16:54:40 +12:00
parent 9dad88e56a
commit 7e9e96c091
13 changed files with 82 additions and 120 deletions
@@ -105,6 +105,12 @@ public class ViewManager {
});
}
/**
* Sets the decorator when a new one is created (and ideally the old one destroyed)
* Also allows injection of buttons into the decorator for custom functions.
*
* @param newDecorator The new JFXDecorator to handle the game window.
*/
private void setDecorator(JFXDecorator newDecorator) {
decorator = newDecorator;
@@ -152,6 +158,9 @@ public class ViewManager {
}
/**
* Determines if a PC has compatibility with the bonjour protocol for server detection.
*/
private void checkCompatibility() {
if (BonjourInstallChecker.isBonjourSupported()) {
BonjourInstallChecker.openInstallUrl();
@@ -209,6 +218,11 @@ public class ViewManager {
return playerList;
}
/**
* Change the view to the Lobby Screen
* @param disableReadyButton Boolean value so that clients can't try start a game.
* @return A LobbyController object for the Lobby Screen.
*/
public LobbyController goToLobby(Boolean disableReadyButton) {
FXMLLoader loader = loadFxml("/views/LobbyView.fxml");
@@ -226,6 +240,11 @@ public class ViewManager {
return loader.getController();
}
/**
* Sets up the view for the race. Creating a new decorator and destroying the old one.
* @return A RaceViewController for the race view screen.
*/
public RaceViewController loadRaceView() {
FXMLLoader loader = loadFxml("/views/RaceView.fxml");
@@ -277,6 +296,7 @@ public class ViewManager {
return loader.getController();
}
// TODO: 12/09/17 ajm412: Why is this here? is there no better way we can do this? Ideally inside the LobbyController.
public JFXDialog loadCustomizationDialog(StackPane parent, LobbyController lobbyController,
Color playerColor, String name) {
FXMLLoader dialog = loadFxml("/views/dialogs/BoatCustomizeDialog.fxml");