-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathCards.java
More file actions
77 lines (55 loc) · 1.28 KB
/
Cards.java
File metadata and controls
77 lines (55 loc) · 1.28 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
public class Cards {
private int cardNumber;
private String cardColor;
private boolean x2;
private boolean joker = false;
public Cards(int cardNumber, String cardColor) {
this.cardNumber = cardNumber;
this.cardColor = cardColor;
}
public Cards(boolean x2) {
this.x2 = x2;
joker = true;
}
public boolean isX2() {
return x2;
}
public void setX2(boolean x2) {
this.x2 = x2;
}
public boolean isJoker() {
return joker;
}
public void setJoker(boolean joker) {
this.joker = joker;
}
public int getCardNumber() {
return cardNumber;
}
public String getCardColor() {
return cardColor;
}
public void setCardNumber(int cardNumber) {
this.cardNumber = cardNumber;
}
public void setCardColor(String cardColor) {
this.cardColor = cardColor;
}
public String getCard(){
if (joker)
{
if(x2)
{
return "2x";
}
else
{
return "+/-";
}
}
else
{
return cardColor+cardNumber;
}
}
}