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:
hba56
2017-09-13 15:17:37 +12:00
parent aafc0dc9db
commit 00780e17e9
6 changed files with 66 additions and 7 deletions
@@ -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;
}
}