-
Notifications
You must be signed in to change notification settings - Fork 0
/
Card.java
41 lines (33 loc) · 889 Bytes
/
Card.java
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
//Vincent Lim
//Card.java
//A card object created by the player
public class Card {
private int rank;
private char suit;
private boolean dealt;
public Card(int rank, char suit){
this.rank = rank;
this.suit = suit;
dealt = false;
}
public int getRank(){
return rank;
}
public char getSuit(){
return suit;
}
public boolean getDealt(){
return dealt;
}
public void setDealt(boolean b){
dealt = b;
}
public String toString(){
return "{Rank/Value: " + rank + ", Suit: " + suit + "}";
}
//This makes it a bit easier for the computer to parse it, the rank is after 'R' and before 'S', and the suit is
//the character after 'S'
public String getComputerReadInfo(){
return "R" + rank + "S" + suit;
}
}