|
@@ -4,22 +4,38 @@ public class Card {
|
4
|
4
|
private Suit suit;
|
5
|
5
|
private Rank rank;
|
6
|
6
|
|
7
|
|
-
|
8
|
|
- protected int[] ranks = {1,2,3,4,5,6,7,8,9,10,11};
|
9
|
|
- protected String[] suits = {"Clubs","Diamonds","Hearts","Spades"};
|
10
|
|
-
|
11
|
|
-
|
12
|
|
-
|
13
|
|
- public int getRank() {
|
14
|
|
-
|
15
|
|
- return -1;
|
16
|
|
- }
|
17
|
|
- public void setSuit() {
|
18
|
|
-
|
19
|
|
- }
|
20
|
|
- public Integer getValue(){
|
21
|
|
- return rank.getPrimaryValue();
|
22
|
|
- }
|
|
7
|
+public Card (Suit suit, Rank rank) {
|
|
8
|
+ this.suit = suit;
|
|
9
|
+ this.rank = rank;
|
|
10
|
+}
|
|
11
|
+
|
|
12
|
+public Suit getSuit(){
|
|
13
|
+ return suit;
|
|
14
|
+}
|
|
15
|
+
|
|
16
|
+public Rank getRank(){
|
|
17
|
+ return rank;
|
|
18
|
+}
|
|
19
|
+
|
|
20
|
+public Integer getValue(){
|
|
21
|
+ return rank.getPrimaryValue();
|
|
22
|
+}
|
|
23
|
+
|
|
24
|
+// protected int[] ranks = {1,2,3,4,5,6,7,8,9,10,11};
|
|
25
|
+// protected String[] suits = {"Clubs","Diamonds","Hearts","Spades"};
|
|
26
|
+//
|
|
27
|
+//
|
|
28
|
+//
|
|
29
|
+// public int getRank() {
|
|
30
|
+//
|
|
31
|
+// return -1;
|
|
32
|
+// }
|
|
33
|
+// public void setSuit() {
|
|
34
|
+//
|
|
35
|
+// }
|
|
36
|
+// public Integer getValue(){
|
|
37
|
+// return rank.getPrimaryValue();
|
|
38
|
+// }
|
23
|
39
|
|
24
|
40
|
|
25
|
41
|
|