瀏覽代碼

Added a return to console

Lauren Green 6 年之前
父節點
當前提交
7cb86fab6b
共有 1 個文件被更改,包括 4 次插入4 次删除
  1. 4
    4
      src/main/java/io/zipcoder/casino/Yahtzee.java

+ 4
- 4
src/main/java/io/zipcoder/casino/Yahtzee.java 查看文件

@@ -1,8 +1,6 @@
1 1
 package io.zipcoder.casino;
2 2
 
3
-import java.lang.reflect.Array;
4 3
 import java.util.ArrayList;
5
-import java.util.Arrays;
6 4
 import java.util.Scanner;
7 5
 
8 6
 public class Yahtzee extends DiceGame implements Game, Gamble{
@@ -10,6 +8,7 @@ public class Yahtzee extends DiceGame implements Game, Gamble{
10 8
     DicePlayer dicePlayer;
11 9
     private Scanner scanner = new Scanner(System.in);
12 10
     int betAmount = 0;
11
+    Console console = new Console();
13 12
 
14 13
     public Yahtzee(Player player) {
15 14
         this.dicePlayer = new DicePlayer(player);
@@ -46,7 +45,8 @@ public class Yahtzee extends DiceGame implements Game, Gamble{
46 45
         System.out.println("You scored " + dicePlayer.getScoreSheet().getTotalScore() + " points.");
47 46
         payout();
48 47
         dicePlayer.printBalanceAtEnd();
49
-        //Return to console.
48
+        System.out.println();
49
+        quit();
50 50
     }
51 51
 
52 52
     public void startRound() {
@@ -207,6 +207,6 @@ public class Yahtzee extends DiceGame implements Game, Gamble{
207 207
     }
208 208
 
209 209
     public void quit() {
210
-        //Return to console
210
+        console.chooseGame();
211 211
     }
212 212
 }