Merge remote-tracking branch 'remotes/origin/temp77' into story77
# Conflicts: # racevisionGame/src/main/java/visualiser/Controllers/InGameLobbyController.java # racevisionGame/src/main/resources/visualiser/scenes/gameLobby.fxml # racevisionGame/src/main/resources/visualiser/scenes/hostgame.fxml
This commit is contained in:
@@ -26,6 +26,7 @@ import javafx.stage.StageStyle;
|
||||
import javafx.util.Duration;
|
||||
import mock.app.Event;
|
||||
|
||||
|
||||
public class App extends Application {
|
||||
private static Stage stage;
|
||||
public static Event game;
|
||||
|
||||
@@ -1,7 +1,37 @@
|
||||
package visualiser.app;
|
||||
|
||||
/**
|
||||
* Created by hba56 on 13/09/17.
|
||||
*/
|
||||
import visualiser.network.MatchBrowserInterface;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.net.DatagramSocket;
|
||||
|
||||
public class MatchBrowserSingleton {
|
||||
private DatagramSocket udpSocket;
|
||||
private MatchBrowserInterface matchBrowserInterface;
|
||||
|
||||
private static MatchBrowserSingleton instance = null;
|
||||
|
||||
public MatchBrowserSingleton() {
|
||||
this.matchBrowserInterface = new MatchBrowserInterface();
|
||||
try{
|
||||
this.udpSocket = matchBrowserInterface.setupMatchBrowserConnection();
|
||||
}catch (IOException e){
|
||||
System.err.println("Error in setting up connection with match browser");
|
||||
}
|
||||
}
|
||||
|
||||
public static MatchBrowserSingleton getInstance() {
|
||||
if (instance == null){
|
||||
instance = new MatchBrowserSingleton();
|
||||
}
|
||||
return instance;
|
||||
}
|
||||
|
||||
public DatagramSocket getUdpSocket() {
|
||||
return udpSocket;
|
||||
}
|
||||
|
||||
public MatchBrowserInterface getMatchBrowserInterface() {
|
||||
return matchBrowserInterface;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user