|
@@ -1,11 +1,17 @@
|
1
|
1
|
package io.zipcoder.casino;
|
2
|
2
|
|
3
|
3
|
public class Yahtzee extends DiceGame implements Game{
|
|
4
|
+
|
4
|
5
|
private Dice[] cup;
|
|
6
|
+ DicePlayer dicePlayer;
|
5
|
7
|
|
|
8
|
+ public Yahtzee(Player player) {
|
|
9
|
+ this.dicePlayer = new DicePlayer(player);
|
|
10
|
+ }
|
6
|
11
|
|
7
|
12
|
public void compareScore(DicePlayer player1, DicePlayer player2){
|
8
|
13
|
|
|
14
|
+ player1.getScoreSheet().getTotalScore();
|
9
|
15
|
}
|
10
|
16
|
|
11
|
17
|
public void reRoll(){
|
|
@@ -23,11 +29,25 @@ public class Yahtzee extends DiceGame implements Game{
|
23
|
29
|
|
24
|
30
|
}
|
25
|
31
|
|
26
|
|
- public void StartGame() {
|
|
32
|
+ public void StartGame(DicePlayer dicePlayer) {
|
|
33
|
+ Dice dice1 = new Dice();
|
|
34
|
+ Dice dice2 = new Dice();
|
|
35
|
+ Dice dice3 = new Dice();
|
|
36
|
+ Dice dice4 = new Dice();
|
|
37
|
+ Dice dice5 = new Dice();
|
|
38
|
+
|
|
39
|
+ dicePlayer.getCup()[0] = dice1;
|
|
40
|
+ dicePlayer.getCup()[1] = dice2;
|
|
41
|
+ dicePlayer.getCup()[2] = dice3;
|
|
42
|
+ dicePlayer.getCup()[3] = dice4;
|
|
43
|
+ dicePlayer.getCup()[4] = dice5;
|
27
|
44
|
|
28
|
45
|
}
|
29
|
46
|
|
30
|
47
|
public void StartRound() {
|
31
|
|
-
|
|
48
|
+ for(Dice d : dicePlayer.getCup()) {
|
|
49
|
+ d.roll();
|
|
50
|
+ }
|
|
51
|
+ dicePlayer.printCup();
|
32
|
52
|
}
|
33
|
53
|
}
|