|
|
|
|
@ -3,6 +3,7 @@ package visualiser.Controllers;
|
|
|
|
|
import javafx.collections.ObservableList;
|
|
|
|
|
import javafx.fxml.FXML;
|
|
|
|
|
import javafx.scene.layout.AnchorPane;
|
|
|
|
|
import javafx.scene.media.AudioClip;
|
|
|
|
|
import visualiser.app.App;
|
|
|
|
|
import visualiser.gameController.ControllerClient;
|
|
|
|
|
import visualiser.model.VisualiserBoat;
|
|
|
|
|
@ -27,6 +28,8 @@ public class MainController extends Controller {
|
|
|
|
|
@FXML private HostController hostController;
|
|
|
|
|
@FXML private LobbyController lobbyController;
|
|
|
|
|
|
|
|
|
|
private AudioClip sound;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Ctor.
|
|
|
|
|
@ -53,6 +56,8 @@ public class MainController extends Controller {
|
|
|
|
|
* @param isHost is connection a host
|
|
|
|
|
*/
|
|
|
|
|
public void enterLobby(Socket socket, Boolean isHost) {
|
|
|
|
|
sound = new AudioClip(this.getClass().getResource("/visualiser/sounds/buttonpress.mp3").toExternalForm());
|
|
|
|
|
sound.play();
|
|
|
|
|
startController.enterLobby(socket, isHost);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@ -74,12 +79,18 @@ public class MainController extends Controller {
|
|
|
|
|
/**
|
|
|
|
|
* Transitions into lobby screen
|
|
|
|
|
*/
|
|
|
|
|
public void enterLobby(){ lobbyController.enterLobby(); }
|
|
|
|
|
public void enterLobby(){
|
|
|
|
|
sound = new AudioClip(this.getClass().getResource("/visualiser/sounds/buttonpress.mp3").toExternalForm());
|
|
|
|
|
sound.play();
|
|
|
|
|
lobbyController.enterLobby(); }
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Transitions into host game screen
|
|
|
|
|
*/
|
|
|
|
|
public void hostGame(){ hostController.hostGame(); }
|
|
|
|
|
public void hostGame(){
|
|
|
|
|
sound = new AudioClip(this.getClass().getResource("/visualiser/sounds/buttonpress.mp3").toExternalForm());
|
|
|
|
|
sound.play();
|
|
|
|
|
hostController.hostGame(); }
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Sets up the css for the start of the program
|
|
|
|
|
|