Blackjack

com.amoebacode.blackjack.strategy
Class StrategyTableRow

java.lang.Object
  |
  +--com.amoebacode.blackjack.strategy.StrategyTableRow

class StrategyTableRow
extends java.lang.Object

StrategyTableRow manages a single row of correct actions in a strategy table.

Version:
0.9
Author:
Jason Gurney

Field Summary
protected  java.util.Map actionRow
          The collection of strategy table actions
 
Constructor Summary
protected StrategyTableRow(CorrectAction[] actions)
          Default protected constructor.
 
Method Summary
protected  CorrectAction getAction(int dealerScore)
          Returns the correct action from this row for the specified dealer score.
protected  void setAction(int dealerScore, CorrectAction action)
          Sets the correct action in this row for the specified dealer score.
protected  void setupActions(CorrectAction[] actions)
          Loads the strategy table actions into the action row hash map.
 
Methods inherited from class java.lang.Object
, clone, equals, finalize, getClass, hashCode, notify, notifyAll, registerNatives, toString, wait, wait, wait
 

Field Detail

actionRow

protected java.util.Map actionRow
The collection of strategy table actions
Constructor Detail

StrategyTableRow

protected StrategyTableRow(CorrectAction[] actions)
Default protected constructor.
Parameters:
actions - an array of strategy table actions
Method Detail

setupActions

protected void setupActions(CorrectAction[] actions)
Loads the strategy table actions into the action row hash map.
Parameters:
actions - an array of strategy table actions

getAction

protected CorrectAction getAction(int dealerScore)
Returns the correct action from this row for the specified dealer score.
Parameters:
dealerScore - the dealer score
Returns:
the CorrectAction for this score

setAction

protected void setAction(int dealerScore,
                         CorrectAction action)
Sets the correct action in this row for the specified dealer score.
Parameters:
dealerScore - the dealer score
action - the CorrectAction for this score

Blackjack

Copyright © 2002 amoebacode.com.