|
@@ -59,11 +59,18 @@ public class War extends CardGame implements Gamble, Game {
|
59
|
59
|
}
|
60
|
60
|
|
61
|
61
|
public void Deal() {
|
62
|
|
-
|
63
|
|
- /*
|
64
|
|
- for every player playing this game (i)
|
65
|
|
- for every card in the deck (j)
|
66
|
|
-
|
67
|
|
- */
|
|
62
|
+ //while there are cards in the deck
|
|
63
|
+ while(super.getDeck().size() != 0){
|
|
64
|
+ //for each player playing the game
|
|
65
|
+ for(int i = 0; i < super.getPlayers().size(); i ++)
|
|
66
|
+ {
|
|
67
|
+ //grab the card from the top (last added) to the deck
|
|
68
|
+ Card card = super.getDeck().get(super.getDeck().size() - 1);
|
|
69
|
+ //get the player whos hand we are adding the card to
|
|
70
|
+ CardPlayer player = super.getPlayers().get(i);
|
|
71
|
+ //add the card to their hand
|
|
72
|
+ player.getHand().add(card);
|
|
73
|
+ }
|
|
74
|
+ }
|
68
|
75
|
}
|
69
|
76
|
}
|