|
@@ -6,7 +6,7 @@ import java.util.Scanner;
|
6
|
6
|
public class Yahtzee extends DiceGame implements Game, Gamble {
|
7
|
7
|
|
8
|
8
|
DicePlayer dicePlayer;
|
9
|
|
- private Scanner scanner = new Scanner(System.in);
|
|
9
|
+ Console console = new Console();
|
10
|
10
|
int betAmount = 0;
|
11
|
11
|
|
12
|
12
|
public Yahtzee(Player player) {
|
|
@@ -37,9 +37,7 @@ public class Yahtzee extends DiceGame implements Game, Gamble {
|
37
|
37
|
|
38
|
38
|
public void startGame() {
|
39
|
39
|
createGame();
|
40
|
|
-
|
41
|
|
- System.out.println("How much would you like to bet on this game?");
|
42
|
|
- int betAmount = scanner.nextInt();
|
|
40
|
+ int betAmount = console.getIntFromUser("How much would you like to bet on this game?");
|
43
|
41
|
setBid(betAmount);
|
44
|
42
|
bet(betAmount);
|
45
|
43
|
|