forked from The-Pheonix21/Blackjack
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathCard.java
More file actions
29 lines (29 loc) · 708 Bytes
/
Card.java
File metadata and controls
29 lines (29 loc) · 708 Bytes
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
public class Card {
private int value;
private String[] strvalue = {"Ace","2","3","4","5","6","7","8","9","10","Jack","Queen","King"};
private int suit;
private String[] suitstr = {"Clubs","Hearts","Diamonds","Spades"};
public Card(int dsuit, int dvalue){
this.value = dvalue;
this.suit = dsuit;
}
public int getValue(){
return this.value;
}
public int getSuit(){
return this.suit;
}
public String getStrCard(){
String cardInfo = strvalue[value-1] + " of "+ suitstr[suit];
return cardInfo;
}
public String getCardImage() {
String temp;
if (strvalue[value-1].equals("10")) {
temp = "10";
}else {
temp=strvalue[value-1].substring(0,1);
}
return temp+suitstr[suit];
}
}