-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathRemoteMain.java
41 lines (34 loc) · 1.03 KB
/
RemoteMain.java
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
package javass;
import java.io.IOException;
import javass.gui.GraphicalPlayerAdapter;
import javass.net.RemotePlayerServer;
import javafx.application.Application;
import javafx.stage.Stage;
/**
* An application to launch a Jass Game remotely.
* @author Célia Houssiaux
* @author Charles Beauville
*
*/
public final class RemoteMain extends Application{
/**
* Starts a Remote game once the client connects.
* @param args no arguments are needed to start a remote game
*/
public static void main(String[] args) {
launch(args);
}
@Override
public void start(Stage primaryStage) throws Exception {
Thread gameThread = new Thread(() -> {
try {
new RemotePlayerServer(new GraphicalPlayerAdapter()).run();
} catch (IOException e) {
throw new Error(e);
}
});
gameThread.setDaemon(true);
gameThread.start();
System.out.println("La partie commencera à la connexion du client…");
}
}