|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectca.ualberta.cs.poker.HandEvaluator
public class HandEvaluator
Class for identifying / comparing / ranking Hands.
Constructor Summary | |
---|---|
HandEvaluator()
|
Method Summary | |
---|---|
int |
compareHands(Hand h1,
Hand h2)
Compares two hands against each other. |
int |
compareHands(int rank1,
Hand h2)
Compares two 5-7 card hands against each other. |
Hand |
getBest5CardHand(Hand h)
Get the best 5 card poker hand from a 7 card hand |
int[][] |
getRanks(Hand board)
Given a board, cache all possible two card combinations of hand ranks, so that lightenting fast hand comparisons may be done later. |
static java.lang.String |
nameHand(Hand h)
Given a hand, return a string naming the hand ('Ace High Flush', etc..) |
int |
rankHand(Card c1,
Card c2,
Hand h)
Get a numerical ranking of this hand. |
static int |
rankHand(Hand h)
Get a numerical ranking of this hand. |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public HandEvaluator()
Method Detail |
---|
public int rankHand(Card c1, Card c2, Hand h)
c1
- first hole cardc2
- second hole cardh
- a 3-5 card hand
public static java.lang.String nameHand(Hand h)
public int compareHands(Hand h1, Hand h2)
h1
- The first handh2
- The second hand
public int compareHands(int rank1, Hand h2)
rank1
- The rank of the first handh2
- The second hand
public int[][] getRanks(Hand board)
public Hand getBest5CardHand(Hand h)
h
- Any 7 card poker hand
public static int rankHand(Hand h)
h
- a 5 to 7 card hand
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |