|
@@ -17,12 +17,10 @@ public class Stud extends CardGame implements Game {
|
17
|
17
|
Printer.printMessage(player.getName() + " shows a " + card.getName()); //PRINT card name to CONSOLE
|
18
|
18
|
}
|
19
|
19
|
|
20
|
|
-
|
21
|
20
|
public boolean getIsDealt(){
|
22
|
21
|
return isDealt;
|
23
|
22
|
}
|
24
|
23
|
|
25
|
|
-
|
26
|
24
|
/**
|
27
|
25
|
* Determine what player wins by looping through player array and then
|
28
|
26
|
* passing each hand to the 'handValue' method
|
|
@@ -143,10 +141,10 @@ public class Stud extends CardGame implements Game {
|
143
|
141
|
}
|
144
|
142
|
|
145
|
143
|
public void startGame() {
|
146
|
|
- setHandSize(3); //SET Hand Size for game(3)
|
147
|
|
- payAnte(this.getPlayers()); //PAY ante (all players)
|
148
|
|
- deal(this.getPlayers()); //DEALS cards/ hands to each player
|
149
|
|
- startRound(); //METHOD called
|
|
144
|
+ setHandSize(3); //SET Hand Size for game(3)
|
|
145
|
+ payAnte(this.getPlayers()); //PAY ante (all players)
|
|
146
|
+ deal(this.getPlayers()); //DEALS cards/ hands to each player
|
|
147
|
+ startRound(); //METHOD called
|
150
|
148
|
|
151
|
149
|
}
|
152
|
150
|
|
|
@@ -179,9 +177,9 @@ public class Stud extends CardGame implements Game {
|
179
|
177
|
* Deal each player(and dealer) 3 face down cards in turn
|
180
|
178
|
*/
|
181
|
179
|
public void deal(ArrayList<CardPlayer> players) {
|
182
|
|
- for(int i = 0; i < getHandSize(); i ++){ //OUTER loop - run 3 times as there are 3 cards per hand
|
183
|
|
- for (int j = 0; j < players.size(); j++) { //INNER loop through each player
|
184
|
|
- players.get(j).getHand().add(getDeck().pullCard()); //ADD card to player hand
|
|
180
|
+ for(int i = 0; i < getHandSize(); i ++){
|
|
181
|
+ for (int j = 0; j < players.size(); j++) {
|
|
182
|
+ players.get(j).getHand().add(getDeck().pullCard());
|
185
|
183
|
}
|
186
|
184
|
}
|
187
|
185
|
isDealt = true;
|