|
@@ -62,8 +62,12 @@ public class Table {
|
62
|
62
|
played = true;
|
63
|
63
|
} else if (choice == 5) // Chips
|
64
|
64
|
{
|
65
|
|
- aPlayer.setTotalChips(aPlayer.getTotalChips() + aConsole.getIntInput("How many more chips would you like?"));
|
66
|
|
- aConsole.println("Great! Here you go! Good Luck!");
|
|
65
|
+ if (aPlayer.getAge() > 20) {
|
|
66
|
+ aPlayer.setTotalChips(aPlayer.getTotalChips() + aConsole.getIntInput("How many more chips would you like?"));
|
|
67
|
+ aConsole.println("Great! Here you go! Good Luck!\n");
|
|
68
|
+ } else {
|
|
69
|
+ aConsole.println("You are not old enough to gamble, so we won't be able to let you purchase any chips.\n");
|
|
70
|
+ }
|
67
|
71
|
} else if (choice == 6) // Cash Out
|
68
|
72
|
{
|
69
|
73
|
play = false;
|
|
@@ -71,7 +75,7 @@ public class Table {
|
71
|
75
|
aConsole.println("You've cashed out " + aPlayer.getTotalChips() + " chips");
|
72
|
76
|
aConsole.println("Please come again!");
|
73
|
77
|
} else {
|
74
|
|
- aConsole.println("That is not an option " + aPlayer.getName() + "... Do better");
|
|
78
|
+ aConsole.println("That is not an option " + aPlayer.getName() + "... Do better\n");
|
75
|
79
|
}
|
76
|
80
|
}
|
77
|
81
|
|