- Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMain.java
More file actions
Latest commit
41 lines (36 loc) · 1.08 KB
/
Copy pathMain.java
File metadata and controls
41 lines (36 loc) · 1.08 KB
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
importcom.trolltech.qt.gui.QApplication;
importjava.io.File;
importjava.io.IOException;
importjava.nio.file.Files;
importjava.nio.file.Path;
importjava.nio.file.Paths;
/**
* Starts the Game
*/
publicclassMain {
/*
* If the first parameter is 'gui', then the game will start with a GUI.
* */
publicstaticvoidmain(String[] args){
Controllercontroller;
QApplicationapp = null;
if (args.length != 0 && args[0].equals("console")) {
controller = newConsoleController();
}else{
app = newQApplication(args);
controller = newGuiController();
}
PathsavePath = Paths.get(newFile("").getAbsolutePath().concat("\\savegames"));
System.out.println(savePath.toString());
if (Files.notExists(savePath)){
try {
Files.createDirectory(savePath);
} catch (IOExceptione){}
}
controller.setSavegamePath(savePath);
if (args.length != 0 && args[0].equals("console")) {
} else {
app.exec();
}
}
}