Added functionality to host game and join a game in lobby. Host name and game name are not implemented yet.
#story[1087]
This commit is contained in:
@@ -6,8 +6,10 @@ import javafx.scene.control.*;
|
||||
import javafx.scene.layout.AnchorPane;
|
||||
import javafx.stage.Stage;
|
||||
import mock.app.App;
|
||||
import visualiser.model.RaceConnection;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.net.Socket;
|
||||
import java.net.URL;
|
||||
import java.util.ResourceBundle;
|
||||
|
||||
@@ -31,7 +33,17 @@ public class HostController extends Controller {
|
||||
}
|
||||
|
||||
public void hostGamePressed() throws IOException{
|
||||
System.out.println("TODO: Run mock");
|
||||
new App().start(new Stage());
|
||||
System.out.println("Run mock");
|
||||
connectSocket();
|
||||
}
|
||||
|
||||
public void connectSocket() {
|
||||
try{
|
||||
Socket socket = new Socket("localhost", 4942);
|
||||
hostWrapper.setVisible(false);
|
||||
parent.enterLobby(socket);
|
||||
} catch (IOException e) { /* Never reached */ }
|
||||
}
|
||||
|
||||
public AnchorPane startWrapper(){
|
||||
|
||||
Reference in New Issue
Block a user