|
@@ -0,0 +1,120 @@
|
|
1
|
+package io.zipcoder.casino;
|
|
2
|
+
|
|
3
|
+// BlackJack
|
|
4
|
+// Solitaire
|
|
5
|
+// Craps
|
|
6
|
+// Roulette?
|
|
7
|
+// Slot Machine?
|
|
8
|
+
|
|
9
|
+// Jackpot option? Low chance but player wins $1mil
|
|
10
|
+//
|
|
11
|
+
|
|
12
|
+import io.zipcoder.casino.CardGame.BlackJack.BlackJack;
|
|
13
|
+import io.zipcoder.casino.DiceGame.Craps.Craps;
|
|
14
|
+import io.zipcoder.casino.CardGame.Solitaire.Solitaire;
|
|
15
|
+import io.zipcoder.casino.Interfaces.Game;
|
|
16
|
+
|
|
17
|
+import java.util.Scanner;
|
|
18
|
+
|
|
19
|
+public final class Casino_test {
|
|
20
|
+
|
|
21
|
+ private final static Casino_test instance = new Casino_test();
|
|
22
|
+
|
|
23
|
+ private Player player;
|
|
24
|
+
|
|
25
|
+ private final String casinoName = "Thunder Theta";
|
|
26
|
+
|
|
27
|
+ private Casino_test() {
|
|
28
|
+ }
|
|
29
|
+
|
|
30
|
+ public void chooseGame() {
|
|
31
|
+ Scanner scanner = new Scanner(System.in);
|
|
32
|
+ System.out.println("\n\nWhat game would you like to play?\n<< BlackJack - Solitaire - Craps - Leave >>");
|
|
33
|
+ String userInput = scanner.nextLine();
|
|
34
|
+ String input = userInput.toUpperCase();
|
|
35
|
+
|
|
36
|
+ boolean flag = true;
|
|
37
|
+
|
|
38
|
+ while (flag) {
|
|
39
|
+ switch (input) {
|
|
40
|
+ case "SOLITAIRE":
|
|
41
|
+ break;
|
|
42
|
+ case "BLACKJACK":
|
|
43
|
+ BlackJack blackJack = new BlackJack(player);
|
|
44
|
+ System.out.println("\nHi " + instance.getPlayer().getName() + "! Welcome to BlackJack!\n\nThe minimum bet is $50.\n");
|
|
45
|
+ flag = false;
|
|
46
|
+ blackJack.start();
|
|
47
|
+ break;
|
|
48
|
+ case "CRAPS":
|
|
49
|
+ Craps craps = new Craps(player);
|
|
50
|
+ flag = false;
|
|
51
|
+ craps.gamePlay();
|
|
52
|
+ break;
|
|
53
|
+ case "LEAVE":
|
|
54
|
+ System.out.println("Thanks for coming to Thunder Theta, good bye!");
|
|
55
|
+ flag = false;
|
|
56
|
+ break;
|
|
57
|
+ default:
|
|
58
|
+ System.out.println("I don't know what that game is. Please try again.");
|
|
59
|
+ break;
|
|
60
|
+ }
|
|
61
|
+ }
|
|
62
|
+ }
|
|
63
|
+
|
|
64
|
+ public void setPlayer(Player player) {
|
|
65
|
+ this.player = player;
|
|
66
|
+ }
|
|
67
|
+
|
|
68
|
+ public Player getPlayer() {
|
|
69
|
+ return this.player;
|
|
70
|
+ }
|
|
71
|
+
|
|
72
|
+ public static Casino_test getInstance() {
|
|
73
|
+ return instance;
|
|
74
|
+ }
|
|
75
|
+
|
|
76
|
+ public String getCasinoName() {
|
|
77
|
+ return this.casinoName;
|
|
78
|
+ }
|
|
79
|
+
|
|
80
|
+ public static void main(String[] args) {
|
|
81
|
+ Scanner scanner = new Scanner(System.in);
|
|
82
|
+ Casino_test instance = Casino_test.getInstance();
|
|
83
|
+ System.out.println("Welcome to " + instance.getCasinoName() + "! What is your name?");
|
|
84
|
+ String playerName = scanner.nextLine();
|
|
85
|
+ Player player = new Player(playerName);
|
|
86
|
+ instance.setPlayer(player);
|
|
87
|
+ instance.chooseGame();
|
|
88
|
+ }
|
|
89
|
+
|
|
90
|
+// private int money;
|
|
91
|
+// private String casinoName;
|
|
92
|
+// private Game game;
|
|
93
|
+// private Player player;
|
|
94
|
+// private String currentGame;
|
|
95
|
+//
|
|
96
|
+// public void selectGame(int gameNum) {
|
|
97
|
+//
|
|
98
|
+// switch (gameNum) {
|
|
99
|
+// case 1:
|
|
100
|
+// Game blackJack = new BlackJack(player);
|
|
101
|
+// break;
|
|
102
|
+// case 2:
|
|
103
|
+// Game solitaire = new Solitaire(player);
|
|
104
|
+// break;
|
|
105
|
+// case 3:
|
|
106
|
+// Game craps = new Craps(player);
|
|
107
|
+// break;
|
|
108
|
+// case 4:
|
|
109
|
+// leaveCasino();
|
|
110
|
+// break;
|
|
111
|
+// default:
|
|
112
|
+// System.out.println("Input unknown, please pick again.");
|
|
113
|
+// break;
|
|
114
|
+// }
|
|
115
|
+// }
|
|
116
|
+//
|
|
117
|
+// public void leaveCasino() {
|
|
118
|
+// }
|
|
119
|
+
|
|
120
|
+}
|