-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMain.java
More file actions
64 lines (53 loc) · 1.64 KB
/
Main.java
File metadata and controls
64 lines (53 loc) · 1.64 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
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
import javax.swing.JFrame;
public class Main {
public static JFrame menuFrame = new JFrame();
public static JFrame ccFrame = new JFrame();
public static JFrame freeplayFrame = new JFrame();
public static FreeplayGame newGame = new FreeplayGame(freeplayFrame);
public static CardCountingSimulatorGame newCCGame = new CardCountingSimulatorGame(ccFrame);
public static enum STATE{
MENU,
FREEPLAY,
CC
};
public static STATE currentState = STATE.MENU;
/**
* main method
* @param args main's args
* @throws InterruptedException in case of menu close or unexpected error
*/
public static void main(String[] args) throws InterruptedException {
if(currentState == STATE.MENU) {
oM();
}
}
/**
* open menu GUI
*/
public static void oM(){
menuFrame.setTitle("Deckster");
menuFrame.setSize(1280, 720);
menuFrame.setLocationRelativeTo(null);
menuFrame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
menuFrame.setResizable(false);
Menu startingComp = new Menu(menuFrame);
menuFrame.add(startingComp);
menuFrame.setVisible(true);
}
/**
* opens CCSim
*/
public static void openCCSim2(){
ccFrame.getContentPane().removeAll();
newCCGame = new CardCountingSimulatorGame(ccFrame);
newCCGame.formGame();
}
/**
* opens Freeplay
*/
public static void openFreeplay2() {
freeplayFrame.getContentPane().removeAll();
newGame = new FreeplayGame(freeplayFrame);
newGame.formGame();
}
}