|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectblackjack.Blackjack
public class Blackjack
| Field Summary |
|---|
| Fields inherited from interface blackjackGUILibrary.BlackjackEngine |
|---|
BLACKJACK, BUST, DEALER_WON, DRAW, GAME_IN_PROGRESS, HAS_21, LESS_THAN_21, PLAYER_WON |
| Constructor Summary | |
|---|---|
Blackjack(java.util.Random randomGenerator,
int numberOfDecks)
|
|
| Method Summary | |
|---|---|
void |
createAndShuffleGameDeck()
Creates and shuffles the card deck using a random number generator. |
void |
deal()
Creates and shuffles the deck. |
double |
getAccountAmount()
Returns the player's account amount |
double |
getBetAmount()
Returns a double representing the bet amount. |
Card[] |
getDealerCards()
Returns dealer's cards. |
int |
getDealerCardsEvaluation()
Returns an integer value that can assume the values LESS_THAN_21 if the dealers's cards have a value less than 21, BUST if the dealers's cards have a value greater than 21, and BLACKJACK if the dealer has an Ace along with a Jack, Queen, or King. |
int[] |
getDealerCardsTotal()
Returns an array representing the possible value(s) associated with the dealers's cards if the card's represent a value less than or equal to 21. |
Card[] |
getGameDeck()
Returns the current deck of cards . |
int |
getGameStatus()
Returns an integer representing the game status. |
int |
getNumberOfDecks()
Returns the number of decks being used. |
Card[] |
getPlayerCards()
Returns player's cards. |
int |
getPlayerCardsEvaluation()
Returns an integer value that can assume the values LESS_THAN_21 if the player's cards have a value less than 21, BUST if the player's cards have a value greater than 21, and BLACKJACK if the player has an Ace along with a Jack, Queen, or King. |
int[] |
getPlayerCardsTotal()
Returns an array representing the possible value(s) associated with the player's cards if the card's represent a value less than or equal to 21. |
void |
playerHit()
Retrieves cards from the deck and assigns the card to player. |
void |
playerStand()
Flips the dealer's card that is currently face down and assigns cards to the dealer as long as the dealer doesn't bust and the cards' have a value less than 16. |
void |
setAccountAmount(double amount)
Updates the player's account with the parameter value. |
boolean |
setBetAmount(double amount)
Updates the bet amount to the provided value if the bet amount does not exceeds the current account amount. |
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public Blackjack(java.util.Random randomGenerator,
int numberOfDecks)
| Method Detail |
|---|
public int getNumberOfDecks()
BlackjackEngine
getNumberOfDecks in interface BlackjackEnginepublic void createAndShuffleGameDeck()
BlackjackEngine
createAndShuffleGameDeck in interface BlackjackEnginepublic Card[] getGameDeck()
BlackjackEngine
getGameDeck in interface BlackjackEnginepublic void deal()
BlackjackEngine
deal in interface BlackjackEnginecreateAndShuffleGameDeckpublic Card[] getDealerCards()
BlackjackEngine
getDealerCards in interface BlackjackEnginepublic int[] getDealerCardsTotal()
BlackjackEngine
getDealerCardsTotal in interface BlackjackEnginepublic int getDealerCardsEvaluation()
BlackjackEngine
getDealerCardsEvaluation in interface BlackjackEnginepublic Card[] getPlayerCards()
BlackjackEngine
getPlayerCards in interface BlackjackEnginepublic int[] getPlayerCardsTotal()
BlackjackEngine
getPlayerCardsTotal in interface BlackjackEnginepublic int getPlayerCardsEvaluation()
BlackjackEngine
getPlayerCardsEvaluation in interface BlackjackEnginepublic void playerHit()
BlackjackEngine
playerHit in interface BlackjackEnginepublic void playerStand()
BlackjackEngine
playerStand in interface BlackjackEnginepublic int getGameStatus()
BlackjackEngine
getGameStatus in interface BlackjackEnginepublic boolean setBetAmount(double amount)
BlackjackEngine
setBetAmount in interface BlackjackEnginepublic double getBetAmount()
BlackjackEngine
getBetAmount in interface BlackjackEnginepublic void setAccountAmount(double amount)
BlackjackEngine
setAccountAmount in interface BlackjackEnginepublic double getAccountAmount()
BlackjackEngine
getAccountAmount in interface BlackjackEngine
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||