Kaynağa Gözat

completely abstract CardGame Class#

Jason Gibbs 6 yıl önce
ebeveyn
işleme
4693c4dd00
1 değiştirilmiş dosya ile 34 ekleme ve 43 silme
  1. 34
    43
      src/main/java/io/zipcoder/casino/CardGame.java

+ 34
- 43
src/main/java/io/zipcoder/casino/CardGame.java Dosyayı Görüntüle

@@ -1,45 +1,36 @@
1 1
 package io.zipcoder.casino;
2
-//
3
-//public abstract class CardGame implements Game, Gamble {
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() {
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) {
41
-//
42
-//    }
43
-//
44
-//
45 2
 
3
+public abstract class CardGame implements Game, Gamble {
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 CardDeck();
15
+
16
+    }
17
+
18
+
19
+    public abstract int drawCard();
20
+
21
+    public abstract void stand();
22
+
23
+    public abstract void startGame();
24
+
25
+    public abstract void endGame();
26
+
27
+    public abstract void declareWinner();
28
+
29
+    public abstract void bet(int currentBet);
30
+
31
+    public abstract void winBet();
32
+
33
+    public abstract void loseBet(Player player);
34
+
35
+
36
+}