|
@@ -2,13 +2,16 @@ package io.zipcoder.casino.Leviathan;
|
2
|
2
|
|
3
|
3
|
|
4
|
4
|
public class Casino {
|
5
|
|
- Console aConsole = new Console();
|
6
|
|
- Player aPlayer;
|
7
|
|
- Table aTable;
|
|
5
|
+ private Console aConsole = new Console();
|
|
6
|
+ private Player aPlayer;
|
8
|
7
|
|
9
|
8
|
public void setaPlayer() {
|
10
|
9
|
String name = aConsole.getStringInput("What is your name?");
|
11
|
10
|
aPlayer = new Player(name.substring(0, 1).toUpperCase() + name.substring(1),0,aConsole.getIntInput("What is your age?"));
|
|
11
|
+ checkAge();
|
|
12
|
+ }
|
|
13
|
+
|
|
14
|
+ private void checkAge(){
|
12
|
15
|
if (aPlayer.getAge() > 20) {
|
13
|
16
|
aPlayer.setTotalChips(aConsole.getIntInput("How many chips would you like to purchase?"));
|
14
|
17
|
} else {
|
|
@@ -17,7 +20,7 @@ public class Casino {
|
17
|
20
|
}
|
18
|
21
|
|
19
|
22
|
public void run() {
|
20
|
|
- aTable = new Table(aPlayer);
|
|
23
|
+ Table aTable = new Table(aPlayer);
|
21
|
24
|
aTable.startGame();
|
22
|
25
|
}
|
23
|
26
|
}
|