-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathHand.java
More file actions
58 lines (44 loc) · 1.27 KB
/
Hand.java
File metadata and controls
58 lines (44 loc) · 1.27 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
package com.pslin.cards;
import java.util.ArrayList;
import java.util.List;
/**
* @author plin
*/
public class Hand {
private List<Card> cards;
private int fullHouseTripleValue;
private int fullHousePairValue;
public Hand() {
cards = new ArrayList<>();
}
public List<Card> getCards() {
return cards;
}
public void setCards(List<Card> cards) {
this.cards = cards;
}
public void addCard(Card card) {
cards.add(card);
}
public int getFullHouseTripleValue() {
return fullHouseTripleValue;
}
public void setFullHouseTripleValue(int fullHouseTripleValue) {
this.fullHouseTripleValue = fullHouseTripleValue;
}
public int getFullHousePairValue() {
return fullHousePairValue;
}
public void setFullHousePairValue(int fullHousePairValue) {
this.fullHousePairValue = fullHousePairValue;
}
@Override
public String toString() {
StringBuilder string = new StringBuilder("Hand{ ");
for(Card c : cards) {
string.append(c.getDisplayValue()).append(c.getSuit().getUnicode()).append(" ");
}
string.append('}');
return string.toString();
}
}