|
@@ -1,5 +1,6 @@
|
1
|
1
|
package io.zipcoder.casino.cardgames;
|
2
|
2
|
|
|
3
|
+import io.zipcoder.casino.cardgames.cards.Deck;
|
3
|
4
|
import io.zipcoder.casino.player.GoFishPlayer;
|
4
|
5
|
import io.zipcoder.casino.player.Player;
|
5
|
6
|
import io.zipcoder.casino.player.Players;
|
|
@@ -7,11 +8,17 @@ import io.zipcoder.casino.player.Players;
|
7
|
8
|
import java.util.ArrayList;
|
8
|
9
|
|
9
|
10
|
public class GoFish extends CardGame {
|
10
|
|
-
|
|
11
|
+ private static Deck drawPile = new Deck();
|
|
12
|
+ // Change Deck to deque;
|
11
|
13
|
private ArrayList<GoFishPlayer> goFishPlayers = new ArrayList<>();
|
12
|
14
|
|
13
|
|
- public GoFish(){
|
|
15
|
+ public static void main(String[] args) {
|
|
16
|
+ System.out.println();
|
|
17
|
+ }
|
|
18
|
+
|
|
19
|
+ public GoFish() {
|
14
|
20
|
readyPlayers();
|
|
21
|
+ runGame();
|
15
|
22
|
}
|
16
|
23
|
|
17
|
24
|
public void readyPlayers() {
|
|
@@ -20,30 +27,62 @@ public class GoFish extends CardGame {
|
20
|
27
|
}
|
21
|
28
|
}
|
22
|
29
|
|
23
|
|
- int setsCount;
|
|
30
|
+ public int getNumberOfCards() { //generate numberOfCards param for below based on number of players
|
|
31
|
+ int numberOfCards;
|
|
32
|
+ if (goFishPlayers.size() <= 3) { //RULES: For 3 players or less, deal each player 7 cards;
|
|
33
|
+ numberOfCards = 7;
|
|
34
|
+ } else { //RULES contd: if more than three players, deal 5 cards each.
|
|
35
|
+ numberOfCards = 5;
|
|
36
|
+ }
|
|
37
|
+ return numberOfCards;
|
|
38
|
+ }
|
24
|
39
|
|
25
|
40
|
@Override
|
26
|
41
|
void dealCards(Player player, int numberOfCards) {
|
27
|
42
|
super.dealCards(player, numberOfCards);
|
28
|
|
- //For 2 to 3 players you deal each player 7 cards.
|
29
|
|
- //If there are more than three players, deal 5 cards each.
|
|
43
|
+ // dealPile = dealPile - numberOfCards;
|
30
|
44
|
}
|
31
|
45
|
|
32
|
|
- public void questionPlayer(String cardRank, Player player) {
|
33
|
|
- //player surrenders cards of specified rank
|
34
|
|
- }
|
|
46
|
+ //
|
|
47
|
+ public void updateDrawPile() {
|
35
|
48
|
|
36
|
|
- public void evalCards() {
|
37
|
|
- //for cards in dealerHand:
|
38
|
|
-// swap cards or go fish
|
39
|
|
- }
|
|
49
|
+// public void play() {
|
|
50
|
+// for (int i = 0; i }
|
40
|
51
|
|
41
|
|
- public void goFish() {
|
42
|
|
- //pull from top of deck
|
43
|
|
- }
|
|
52
|
+// int setsCount;
|
44
|
53
|
|
45
|
|
- public void checkSets() {
|
46
|
|
- // check if 4 in dealerHand have same value
|
47
|
|
- }
|
48
|
54
|
|
|
55
|
+ //while (drawPile > 0) {
|
|
56
|
+ //public void questionPlayer(String cardRank, Player player) {
|
|
57
|
+ //start w/ player
|
|
58
|
+ //for (deck.size aka (52 cards - numOfCards per player))
|
|
59
|
+ //askPlayerQuestion(); Prompt w/ question of who to ask [console output?]
|
|
60
|
+ //take userInput [console input?]
|
|
61
|
+ //askPlayerCard(); Prompt w/question of what card (rank) to look for [console output?]
|
|
62
|
+ //take userInput[console input?]
|
|
63
|
+ //for cardHand(chosen player)
|
|
64
|
+ //evalCards(userInput): If userInput.equals(card[i].cardGetValue)
|
|
65
|
+ //swap();
|
|
66
|
+ //repeat until userInput != cardGetValue
|
|
67
|
+ //else
|
|
68
|
+ //goFish(); draw a card from Deck - (deck - 1)
|
|
69
|
+ //move to next player;
|
|
70
|
+ //checkSets: run through each cardHand and looks for 4 of a kind;
|
|
71
|
+ //if found, setsCount++;
|
|
72
|
+
|
|
73
|
+
|
|
74
|
+// public void evalCards() {
|
|
75
|
+// //for cards in dealerHand:
|
|
76
|
+//// swap cards or go fish
|
|
77
|
+// }
|
|
78
|
+//
|
|
79
|
+// public void goFish() {
|
|
80
|
+// //pull from top of deck
|
|
81
|
+// }
|
|
82
|
+//
|
|
83
|
+// public void checkSets() {
|
|
84
|
+// // check if 4 in dealerHand have same value
|
|
85
|
+// }
|
|
86
|
+
|
|
87
|
+ }
|
49
|
88
|
}
|