소스 검색

new changes

Xcuello 5 년 전
부모
커밋
baaa97c948

+ 7
- 2
src/main/java/io/zipcoder/casino/BlackjackDealer.java 파일 보기

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

+ 1
- 0
src/main/java/io/zipcoder/casino/BlackjackPlayer.java 파일 보기

7
 
7
 
8
         super(name, moneyStartedWith);
8
         super(name, moneyStartedWith);
9
     }
9
     }
10
+
10
 }
11
 }

+ 3
- 0
src/main/java/io/zipcoder/casino/Card.java 파일 보기

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

+ 0
- 3
src/main/java/io/zipcoder/casino/Deck.java 파일 보기

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

+ 3
- 0
src/main/java/io/zipcoder/casino/Hand.java 파일 보기

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

+ 1
- 0
src/main/java/io/zipcoder/casino/Suit.java 파일 보기

9
     private final String symbol;
9
     private final String symbol;
10
 
10
 
11
     Suit(String symbol) {
11
     Suit(String symbol) {
12
+
12
         this.symbol = symbol;
13
         this.symbol = symbol;
13
     }
14
     }
14
 }
15
 }

+ 3
- 3
src/main/java/io/zipcoder/casino/Wallet.java 파일 보기

10
         this.money = moneyStartedWith;
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
     public double addMoney(double amountAwarded){
17
     public double addMoney(double amountAwarded){
18
         money += amountAwarded;
18
         money += amountAwarded;

+ 0
- 2
src/test/java/io/zipcoder/casino/PlayerTest.java 파일 보기

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