|
@@ -1,27 +1,81 @@
|
1
|
1
|
package io.zipcoder.casino.DiceGame.Craps;
|
2
|
2
|
|
|
3
|
+import io.zipcoder.casino.CardGame.Solitaire.Tableau;
|
|
4
|
+import io.zipcoder.casino.DiceGame.Dice;
|
3
|
5
|
import io.zipcoder.casino.DiceGame.DiceGame;
|
4
|
6
|
import io.zipcoder.casino.Interfaces.Gamble;
|
5
|
7
|
import io.zipcoder.casino.Player;
|
6
|
8
|
|
|
9
|
+import java.lang.reflect.Array;
|
|
10
|
+import java.util.ArrayList;
|
7
|
11
|
import java.util.Map;
|
8
|
12
|
|
9
|
13
|
public class Craps extends DiceGame implements Gamble {
|
10
|
14
|
|
|
15
|
+
|
|
16
|
+ public int[] betOptions = {2, 3, 4, 5, 6, 8, 9, 10, 11, 12};
|
|
17
|
+ int rollNumber = 0;
|
|
18
|
+ private ArrayList<CrapsPlayers> crapsPlayers;
|
|
19
|
+ private int minBet;
|
11
|
20
|
private Player player;
|
12
|
|
- private int hold;
|
13
|
21
|
private Map<Integer, Integer> betPots;
|
|
22
|
+ private Dice dice;
|
|
23
|
+ private int pointer;
|
|
24
|
+
|
|
25
|
+ public int getPointer() {
|
|
26
|
+ return pointer;
|
|
27
|
+ }
|
|
28
|
+
|
|
29
|
+ public void setPointer(int pointer) {
|
|
30
|
+ this.pointer = pointer;
|
|
31
|
+ }
|
|
32
|
+
|
14
|
33
|
|
15
|
34
|
public Craps(Player player) {
|
16
|
|
- this.player = player;
|
|
35
|
+ CrapsPlayers crappyPlayer = new CrapsPlayers(player);
|
|
36
|
+ ArrayList<Integer> betOptions = new ArrayList<>(10);
|
|
37
|
+ this.crapsPlayers = new ArrayList<>();
|
|
38
|
+ this.minBet = 10;
|
|
39
|
+ this.dice = new Dice();
|
17
|
40
|
}
|
18
|
41
|
|
19
|
42
|
public int rollDice() {
|
20
|
|
- return 0;
|
|
43
|
+ int sum = rollDice(2);
|
|
44
|
+ System.out.println("Total = " + sum);
|
|
45
|
+ rollNumber++;
|
|
46
|
+ return sum;
|
|
47
|
+ }
|
|
48
|
+
|
|
49
|
+ public void firstRoll() {
|
|
50
|
+ rollDice();
|
|
51
|
+ if (rollDice() == 7 || rollDice() == 11) {
|
|
52
|
+ //player wins!!
|
|
53
|
+ } else if (rollDice() == 2 || rollDice() == 3 || rollDice() == 12) {
|
|
54
|
+ //player loses :(
|
|
55
|
+ } else {
|
|
56
|
+ pointer = rollDice();
|
|
57
|
+ }
|
|
58
|
+ }
|
|
59
|
+
|
|
60
|
+ public void remainingRolls() {
|
|
61
|
+ rollDice();
|
|
62
|
+ if (rollDice() == pointer) {
|
|
63
|
+ //player wins pot
|
|
64
|
+ } else if (rollDice() == 7) {
|
|
65
|
+ //player loses all money in pot
|
|
66
|
+ } else {
|
|
67
|
+ //if betOptions == rollDice()
|
|
68
|
+ //casino adds money to the pot - matching whatever bet the player made
|
|
69
|
+ }
|
21
|
70
|
}
|
22
|
71
|
|
23
|
72
|
public int betAmount(int amount, Player player) {
|
24
|
|
- return 0;
|
|
73
|
+ return amount;
|
|
74
|
+ }
|
|
75
|
+
|
|
76
|
+ public void bet() {
|
|
77
|
+
|
|
78
|
+
|
25
|
79
|
}
|
26
|
80
|
|
27
|
81
|
public void distributePot(int amount, Player player) {
|
|
@@ -29,6 +83,8 @@ public class Craps extends DiceGame implements Gamble {
|
29
|
83
|
}
|
30
|
84
|
|
31
|
85
|
public void start() {
|
|
86
|
+ //when starting a game passLine bet or dontPassLine bet is made
|
|
87
|
+
|
32
|
88
|
|
33
|
89
|
}
|
34
|
90
|
|
|
@@ -41,10 +97,18 @@ public class Craps extends DiceGame implements Gamble {
|
41
|
97
|
}
|
42
|
98
|
|
43
|
99
|
public void addPlayer(Player player) {
|
44
|
|
-
|
|
100
|
+ CrapsPlayers crappyPlayer = new CrapsPlayers(player);
|
|
101
|
+ this.crapsPlayers.add(crappyPlayer);
|
45
|
102
|
}
|
46
|
103
|
|
47
|
104
|
public void removePlayer(Player player) {
|
|
105
|
+ for (CrapsPlayers crappyPlayer : crapsPlayers) {
|
|
106
|
+ if (crappyPlayer.getPlayer() == player) {
|
|
107
|
+ this.crapsPlayers.remove(crappyPlayer);
|
|
108
|
+ break;
|
|
109
|
+ }
|
|
110
|
+
|
|
111
|
+ }
|
48
|
112
|
|
49
|
113
|
}
|
50
|
|
-}
|
|
114
|
+}
|