|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.gbayer.basicblackjack.Hand
public class Hand
A Hand
contains Cards
currently held by a
Player
Nested Class Summary | |
---|---|
static class |
Hand.Result
The Enum Result. |
Field Summary | |
---|---|
static int |
ACE_UPGRADE_VALUE
Constant - Difference between low and high value of an ace. |
static int |
MAX_HAND_VALUE
Constant - Highest value a hand can have before busting. |
Constructor Summary | |
---|---|
Hand()
Instantiates a new hand. |
Method Summary | |
---|---|
void |
addCard(Card card)
Adds a card to the hand. |
void |
clear()
Clear all cards in hand. |
int |
getTotalHandValue()
Calculates total hand value. |
java.lang.String |
toString()
Generates string representing all cards in the hand. |
java.lang.String |
toStringShowingTopCardOnly()
Generates string showing top card in hand openly and all others as X (face down). |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public static final int MAX_HAND_VALUE
public static final int ACE_UPGRADE_VALUE
Constructor Detail |
---|
public Hand()
Method Detail |
---|
public void addCard(Card card)
card
- the cardpublic void clear()
public int getTotalHandValue()
public java.lang.String toString()
toString
in class java.lang.Object
public java.lang.String toStringShowingTopCardOnly()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |