com.gbayer.basicblackjack
Class ComputerDealer

java.lang.Object
  extended by com.gbayer.basicblackjack.Player
      extended by com.gbayer.basicblackjack.ComputerDealer

public class ComputerDealer
extends Player

Player that follows BlackJack dealer decision rules and does not interact with UI.


Nested Class Summary
 
Nested classes/interfaces inherited from class com.gbayer.basicblackjack.Player
Player.Action
 
Field Summary
static int STAY_VALUE
          Constant - Hand value at which dealer must Stay.
 
Constructor Summary
ComputerDealer(java.lang.String name)
          Instantiates a new computer dealer.
 
Method Summary
 Player.Action takeAction(UI ui)
          Dealer takes action based on current hand value and dealer rules.
 
Methods inherited from class com.gbayer.basicblackjack.Player
dealCard, getHand, getName, newHand, toString, toStringShowingTopCardOnly
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

STAY_VALUE

public static final int STAY_VALUE
Constant - Hand value at which dealer must Stay.

See Also:
Constant Field Values
Constructor Detail

ComputerDealer

public ComputerDealer(java.lang.String name)
Instantiates a new computer dealer.

Parameters:
name - the name assigned to this player
Method Detail

takeAction

public Player.Action takeAction(UI ui)
Dealer takes action based on current hand value and dealer rules.

Specified by:
takeAction in class Player
Parameters:
ui - the user interface
Returns:
action taken