-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathCard.java
More file actions
36 lines (36 loc) · 733 Bytes
/
Card.java
File metadata and controls
36 lines (36 loc) · 733 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
30
31
32
33
34
35
36
public class Card {
private String value;
private int num;
public Card(String value) {
this.value = value;
String temp = value.substring(0,1);
switch(temp) { // this gets the numerical value of the card FOR POKER ONLY!
case "T":
num = 10;
break;
case "J":
num = 11;
break;
case "Q":
num = 12;
break;
case "K":
num = 13;
break;
case "A":
num = 14;
break;
default:
num = Integer.parseInt(temp);
}
}
public String getValue() {
return value;
}
public int getNum() {
return num;
}
public String toString() {
return value;
}
}