Class: BlackJackBot

BlackJackBot

new BlackJackBot()

Creates a new BlackJackBot
Source:

Methods

cardDealt(state, position, card)

Method that is called whenever a card is dealt to any player in the game. This includes the current player, players before and after this player and the dealer.
Parameters:
Name Type Description
state Object State tracking object
position number The position at the table (order number) of the player being dealt this card.
card Card The card that was dealt.
Source:

cardsShuffled()

Function that is called whenever a new shoe is shuffled.
Source:

playTurn(state, turnStatus) → {PlayerAction}

Function that is called for each player (in order of position) after the cards have been dealt. If this function returns PlayerAction.Hit and the player hasn't already busted, then a new card will be dealt to the player (the cardDealt event will fire) and this function will be called again with the updated TurnStatus object..
Parameters:
Name Type Description
state object The current state of the application
turnStatus TurnStatus Information about your hand and the dealer's face up card
Source:
Returns:
- Whether the player would like another card (PlayerAction.Hit) or would like to play out round with their current cards (PlayerAction.Stand)
Type
PlayerAction

registerBot(state, position) → {string}

Function that is called one time per bot to register the bot with the game.
Parameters:
Name Type Description
state Object State tracking object. You can add any JSON serializable properties to this object and they will be retained as this object is passed in to each other method on your bot.
position number The seat number or position of this bot at the table.
Source:
Returns:
- The name to use to identify this bot.
Type
string

roundComplete(state, roundResults)

Function that is called on each bot after a single round is complete.
Parameters:
Name Type Description
state object The current state of the application
roundResults RoundResults an object containing the results (you vs dealer only) for this round. This includes the win/loss/push status as well as the full hand for you and the dealer.
Source: