|
-footer | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectgarrettsmith.blackjack.Hand
public class Hand
Represents a player's hand of cards.
| Method Summary | |
|---|---|
int |
getBestValue()
Returns the highest hand value without busting, if possible. |
CardList |
getCards()
Returns the player's cards that represent this hand. |
Card |
getDealerCard()
Returns the card that the dealer displays to the players. |
int |
getDealerValue()
Calculates the value of the dealer's card assuming an ace is worth 1. |
int |
getValue()
Returns the value of the hand assuming all aces are worth 1. |
double |
getWager()
Returns the amount that was bet on this hand. |
boolean |
isBusted()
Returns whether this hand has gone over 21. |
boolean |
isDoubleDownAllowed()
Returns whether a double down is allowed at this point in the game. |
boolean |
isHitAllowed()
Returns whether a hit is allowed at this point in the hand. |
boolean |
isMoveAllowed(Move move)
Returns whether move is allowed at this point in the game. |
boolean |
isSoft()
Tells whether the hand is soft. |
boolean |
isSplitAllowed()
Returns whether a split is allowed at this point in the hand. |
boolean |
isStandAllowed()
Returns whether standing is allowed at this point in the game. |
boolean |
isSurrenderAllowed()
Returns whether a surrender is allowed. |
java.lang.String |
toString()
Returns the state of this hand as a human-readable String. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Method Detail |
|---|
public int getBestValue()
getValue()public int getValue()
getBestValue()public CardList getCards()
List of Card objectsCardpublic Card getDealerCard()
public int getDealerValue()
public boolean isBusted()
public boolean isDoubleDownAllowed()
true if a double down is allowed, false
if notpublic boolean isStandAllowed()
public double getWager()
public boolean isMoveAllowed(Move move)
move is allowed at this point in the game.
public boolean isHitAllowed()
true if a hit is allowed, false if notpublic boolean isSoft()
true if the hand is soft, false if
notpublic boolean isSplitAllowed()
true if a split is allowed, false if
notpublic java.lang.String toString()
toString in class java.lang.Objectpublic boolean isSurrenderAllowed()
true if a surrender is allowed, false
if not
|
-footer | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||