浏览代码

new changes

Xcuello 5 年前
父节点
当前提交
baaa97c948

+ 7
- 2
src/main/java/io/zipcoder/casino/BlackjackDealer.java 查看文件

@@ -8,15 +8,17 @@ public class BlackjackDealer extends BlackjackPlayer {
8 8
     private Deck deck;
9 9
 
10 10
     public BlackjackDealer(String name, double moneyStartedWith) {
11
+
11 12
         super(name, moneyStartedWith);
12 13
     }
13 14
 
14 15
 //    private BlackjackDealer(Hand hand, Deck deck) {
16
+//
15 17
 //        this.hand = hand;
16 18
 //        this.deck = deck;
17 19
 //    }
18
-
19
-
20
+//
21
+//
20 22
 //        public Card hit(){
21 23
 //            Card c = dealCards();
22 24
 //            hand.add(c);
@@ -29,13 +31,16 @@ public class BlackjackDealer extends BlackjackPlayer {
29 31
 //        }
30 32
 //
31 33
 //        public void newDeck(){
34
+//
32 35
 //        if (deck.isEmpty()){
36
+//
33 37
 //            deck = Deck.createDeck();
34 38
 //            }
35 39
 //        }
36 40
 
37 41
 
38 42
         public Hand viewHand(){
43
+
39 44
         return hand;
40 45
         }
41 46
 

+ 1
- 0
src/main/java/io/zipcoder/casino/BlackjackPlayer.java 查看文件

@@ -7,4 +7,5 @@ public class BlackjackPlayer extends Player {
7 7
 
8 8
         super(name, moneyStartedWith);
9 9
     }
10
+
10 11
 }

+ 3
- 0
src/main/java/io/zipcoder/casino/Card.java 查看文件

@@ -10,14 +10,17 @@ public class Card {
10 10
     }
11 11
 
12 12
     public Suit getSuit() {
13
+
13 14
         return suit;
14 15
     }
15 16
 
16 17
     public Rank getRank() {
18
+
17 19
         return rank;
18 20
     }
19 21
 
20 22
     public Integer getValue(){
23
+
21 24
         return rank.primaryValue;
22 25
     }
23 26
 }

+ 0
- 3
src/main/java/io/zipcoder/casino/Deck.java 查看文件

@@ -12,8 +12,6 @@ public class Deck {
12 12
     private Stack<Card> deck;
13 13
 
14 14
 
15
-
16
-
17 15
     public Deck(){
18 16
         this.deck = new Stack<Card>();
19 17
         for (Suit suit : Suit.values()){
@@ -24,7 +22,6 @@ public class Deck {
24 22
     }
25 23
 
26 24
 
27
-
28 25
     public Integer size(){
29 26
 
30 27
         return deck.size();

+ 3
- 0
src/main/java/io/zipcoder/casino/Hand.java 查看文件

@@ -7,6 +7,7 @@ public class Hand {
7 7
     private  List<Card> cards = new ArrayList<Card>();
8 8
 
9 9
     public void clear(){
10
+
10 11
         cards.clear();
11 12
     }
12 13
 
@@ -27,6 +28,7 @@ public class Hand {
27 28
 
28 29
 
29 30
     public List<Card> getCards() {
31
+
30 32
         return cards;
31 33
     }
32 34
 
@@ -36,6 +38,7 @@ public class Hand {
36 38
     }
37 39
 
38 40
     public boolean contains(Card card){
41
+
39 42
         return this.cards.contains(card);
40 43
     }
41 44
 }

+ 1
- 0
src/main/java/io/zipcoder/casino/Suit.java 查看文件

@@ -9,6 +9,7 @@ public enum  Suit {
9 9
     private final String symbol;
10 10
 
11 11
     Suit(String symbol) {
12
+
12 13
         this.symbol = symbol;
13 14
     }
14 15
 }

+ 3
- 3
src/main/java/io/zipcoder/casino/Wallet.java 查看文件

@@ -10,9 +10,9 @@ public class Wallet {
10 10
         this.money = moneyStartedWith;
11 11
     }
12 12
 
13
-//    public double getMoney(double money) {
14
-//        return money;
15
-//    }
13
+    public double getMoney(double money) {
14
+        return money;
15
+    }
16 16
 
17 17
     public double addMoney(double amountAwarded){
18 18
         money += amountAwarded;

+ 0
- 2
src/test/java/io/zipcoder/casino/PlayerTest.java 查看文件

@@ -1,11 +1,9 @@
1 1
 package io.zipcoder.casino;
2 2
 
3
-import io.zipcoder.casino.*;
4 3
 import org.junit.Assert;
5 4
 import org.junit.Before;
6 5
 import org.junit.Test;
7 6
 
8
-import java.util.List;
9 7
 
10 8
 public class PlayerTest {
11 9