tables
Class BlackjackTable

java.lang.Object
  extended by common.Table
      extended by tables.BlackjackTable

public class BlackjackTable
extends Table


Field Summary
static int HIT
          Specifies that the player wants to hit.
static int STAYING
          Specifies that the player wants to stay.
 
Fields inherited from class common.Table
deck, DRAW, FULL, hands, LOSS, NUMBER_OF_GAMES, numPlayers, players, started, type, WIN
 
Constructor Summary
BlackjackTable()
          Default constructor for BlackjackTable that calls the default constructor of Table.
BlackjackTable(int numPlayers, java.lang.String type)
          Constructs a new Table with the specified amount of players needed at this Table to start the game and the ServerThread associated with the first player (master) at this Table.
 
Method Summary
 void beginGame()
          Called when the table is FULL.
 void handleMessage(java.lang.Object o, int fromClientNum)
          Handles incoming messages from players at this table.
 
Methods inherited from class common.Table
addPlayer, getNextAvailableSlot, getType, initialize, removePlayer, removePlayer, sendResults, sendTo
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

HIT

public static final int HIT
Specifies that the player wants to hit.

See Also:
Constant Field Values

STAYING

public static final int STAYING
Specifies that the player wants to stay.

See Also:
Constant Field Values
Constructor Detail

BlackjackTable

public BlackjackTable()
Default constructor for BlackjackTable that calls the default constructor of Table.


BlackjackTable

public BlackjackTable(int numPlayers,
                      java.lang.String type)
Constructs a new Table with the specified amount of players needed at this Table to start the game and the ServerThread associated with the first player (master) at this Table.

Parameters:
numPlayers - int is the number of players needed at this Table to start the game.
type - String is the game that is being played at this table. at this Table.
Method Detail

handleMessage

public void handleMessage(java.lang.Object o,
                          int fromClientNum)
Handles incoming messages from players at this table. Takes the appropriate action based on the incoming message.

Specified by:
handleMessage in class Table
Parameters:
o - NetworkObject the incoming message.
fromClientNum - int the player number of the player that sent this message.

beginGame

public void beginGame()
Description copied from class: Table
Called when the table is FULL. Creates a Deck, deals a Hand to each player at the Table, and storesvthe remains of the Deck (if any) as a global variable. When each hand is dealt, it stores each Hand in an array.

Specified by:
beginGame in class Table