|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object wyvern.lib.classes.games.card.Hand
Represents a 5-card hand, which is an unordered set of 5 cards chosen from the standard deck of 52. Each of the 5 cards must have a unique combination of face and suit.
Field Summary |
Constructor Summary | |
Hand(Card c1,
Card c2,
Card c3,
Card c4,
Card c5)
Constructs a new Hand |
Method Summary | |
protected void |
analyze()
Looks at the cards and determines what type of hand it is (nothing, one pair, two pair, three of a kind, etc.) |
boolean |
contains(Card card)
Returns true if the hand contains the specified Card. |
boolean |
equals(java.lang.Object obj)
Returns true if this Hand is equal to another one. |
HandType |
getType()
Analyzes the hand and returns the type, e.g. straight flush. |
int |
hashCode()
We overrode equals(), so we need to override hashcode(). |
Methods inherited from class java.lang.Object |
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public Hand(Card c1, Card c2, Card c3, Card c4, Card c5)
Method Detail |
protected void analyze()
public boolean contains(Card card)
card
- a Card object to check
public boolean equals(java.lang.Object obj)
public int hashCode()
public HandType getType()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |