Jason Gibbs 6 years ago
parent
commit
15b1847747

+ 36
- 36
src/main/java/io/zipcoder/casino/CardGame.java View File

2
 
2
 
3
 public abstract class CardGame implements Game, Gamble {
3
 public abstract class CardGame implements Game, Gamble {
4
 
4
 
5
-    int playerHand;
6
-    int dealerHand;
7
-    int currentBet;
8
-    Player player;
9
-    CardDeck deck;
10
-
11
-    public CardGame(Player player) {
12
-
13
-        this.player = player;
14
-        this.deck = new deck();
15
-
16
-    }
17
-
18
-
19
-    public int drawCard() {
20
-
21
-
22
-    }
23
-
24
-    public void stand() {
5
+//    int playerHand;
6
+//    int dealerHand;
7
+//    int currentBet;
8
+//    Player player;
9
+//    CardDeck deck;
10
+//
11
+//    public CardGame(Player player) {
12
+//
13
+//        this.player = player;
14
+//        this.deck = new deck();
15
+//
16
+//    }
17
+//
18
+//
19
+//    public int drawCard() {
20
+//
21
+//
22
+//    }
23
+//
24
+//    public void stand() {
25
+//
26
+//    }
27
+//
28
+//    void startGame();
29
+//
30
+//    void endGame();
31
+//
32
+//    void declareWinner();
33
+//
34
+//    void bet(int currentBet) {
35
+//
36
+//    }
37
+//    void winBet() {
38
+//
39
+//    }
40
+//    void loseBet(Player player) {
25
 
41
 
26
     }
42
     }
27
 
43
 
28
-    void startGame();
29
-
30
-    void endGame();
31
-
32
-    void declareWinner();
33
-
34
-    void bet(int currentBet) {
35
-
36
-    }
37
-    void winBet() {
38
-
39
-    }
40
-    void loseBet(Player player) {
41
-
42
-    }
43
 
44
 
44
 
45
 
45
-}

+ 19
- 13
src/main/java/io/zipcoder/casino/Casino.java View File

5
 
5
 
6
     private Player player;
6
     private Player player;
7
     private String choice;
7
     private String choice;
8
+    private Console console;
8
     //GameFactory gf;
9
     //GameFactory gf;
9
 
10
 
10
-//    public void startCasino() {
11
-//        do {
12
-//            System.out.println("Welcome to the Zip Code Casino!");
13
-//            System.out.println("Which game would you like to play? :");
14
-//            System.out.println("1: BlackJack");
15
-//            System.out.println("2: Baccarat");
16
-//            System.out.println("3: Craps");
17
-//
18
-//            if () {
19
-//
20
-//            }
21
-//        }
22
-//    }
11
+    public void startCasino() {
12
+        do {
13
+            System.out.println("Welcome to the Zip Code Casino!");
14
+            System.out.println("Which game would you like to play? ");
15
+            System.out.println("1: BlackJack");
16
+            System.out.println("2: Baccarat");
17
+            choice = Console.askForInput("3: Craps");
18
+            System.out.println(choice);
19
+
20
+            if (choice.equalsIgnoreCase("1")) {
21
+
22
+            }
23
+        } while (false);
24
+
25
+        }
26
+ //   }
23
 
27
 
24
     public static void main(String[] args) {
28
     public static void main(String[] args) {
25
 
29
 
29
         cardDeck.getDeck();
33
         cardDeck.getDeck();
30
         System.out.println(cardDeck.draw());
34
         System.out.println(cardDeck.draw());
31
         cardDeck.deal(2);
35
         cardDeck.deal(2);
36
+        Casino cas = new Casino();
37
+        cas.startCasino();
32
     }
38
     }
33
 }
39
 }

+ 5
- 5
src/main/java/io/zipcoder/casino/Gamble.java View File

4
 
4
 
5
 
5
 
6
 
6
 
7
-     int currentBet;
8
-
9
-     void bet(int);
10
-     void winBet(Player);
11
-     void loseBet(Player);
7
+//     int currentBet;
8
+//
9
+//     void bet(int);
10
+//     void winBet(Player);
11
+//     void loseBet(Player);
12
 
12
 
13
 
13
 
14
 
14
 

+ 1
- 1
src/main/java/io/zipcoder/casino/Game.java View File

2
 
2
 
3
 public interface Game {
3
 public interface Game {
4
    // variable of Player type
4
    // variable of Player type
5
-    Player player;
5
+   // Player player;
6
 
6
 
7
     void startGame();
7
     void startGame();
8
 
8
 

+ 4
- 4
src/main/java/io/zipcoder/casino/Main.java View File

1
 package io.zipcoder.casino;
1
 package io.zipcoder.casino;
2
 
2
 
3
 public class Main {
3
 public class Main {
4
-    public static void main(String[] args){
5
-        Casino casino =  new Casino();
6
-        casino.start();
4
+//    public static void main(String[] args){
5
+//        Casino casino =  new Casino();
6
+//        casino.start();
7
 
7
 
8
-    }
8
+//    }
9
 
9
 
10
 
10
 
11
 }
11
 }