-
Notifications
You must be signed in to change notification settings - Fork 0
/
TwoPair.java
35 lines (29 loc) · 950 Bytes
/
TwoPair.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
import java.util.ArrayList;
/**
* Created by vince on 4/20/2017.
*/
public class TwoPair extends PokerHand{
private Pair pair1;
private Pair pair2;
private ArrayList<Card> kickers;
//tiebreaker is based on who has the better pair1, then pair2.
//pair 1 is always the better pair, e.g. two pair of jacks and threes, pair1 would equal jacks(11)
public TwoPair(Pair pair1, Pair pair2, ArrayList<Card> kickers){
super(8);
this.pair1 = pair1;
this.pair2 = pair2;
this.kickers = kickers;
}
public Pair getPair1(){
return pair1;
}
public Pair getPair2(){
return pair2;
}
public ArrayList<Card> getKickers(){
return kickers;
}
public String toString(){
return "two pair, " + HandEvaluator.rankToString(pair1.getRank()) + "'s and " + HandEvaluator.rankToString(pair2.getRank()) + "'s";
}
}