|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object blackjackanalyst.Table
public class Table
A blackjack table.
Constructor Summary | |
---|---|
Table(int _max_players,
DealerStrategy _dealer_strat,
int _min_bet,
int _max_bet)
Creates a new unnamed table with the given maximum number of players, dealer strategy, and minimum bet and maximum bet. |
|
Table(java.lang.String _name,
int _max_players,
DealerStrategy _dealer_strat,
int _min_bet,
int _max_bet)
Creates a new table with the given name, maximum number of players, dealer strategy, and minimum bet and maximum bet. |
Method Summary | |
---|---|
boolean |
addPlayer(Player p)
Attempts to add the given player to the table. |
int |
getMaximumBet()
Returns the maximum bet at the table. |
int |
getMaxPlayers()
Returns the maximum number of players at this blackjack table. |
int |
getMinimumBet()
Returns the minimum bet at the table. |
java.lang.String |
getName()
Returns the name of the table. |
int |
getNumPlayers()
Returns the number of players at this blackjack table. |
ObserverList<TableObserver> |
getObservers()
Returns the list of observers, to which observers for this table can be added, removed, and so forth. |
java.util.List<Player> |
getPlayers()
Returns a list containing all the players at the blackjack table. |
DealerStrategy |
getStrategy()
Returns the strategy used by the dealer. |
boolean |
hasRoom()
Returns whether there is room for more players at the blackjack table. |
void |
playRound()
Plays a single round of blackjack. |
void |
playRounds(int num_rounds)
Plays the given number of rounds of blackjack. |
boolean |
removePlayer(Player p)
Attempts to remove the given player from the table. |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public Table(int _max_players, DealerStrategy _dealer_strat, int _min_bet, int _max_bet)
_max_players
- the maximum number of blackjack players_dealer_strat
- the strategy used by the dealer_min_bet
- the minimum bet at this table_max_bet
- the maximum bet at this tablepublic Table(java.lang.String _name, int _max_players, DealerStrategy _dealer_strat, int _min_bet, int _max_bet)
_name
- the name of the blackjack table_max_players
- the maximum number of blackjack players_dealer_strat
- the strategy used by the dealer_min_bet
- the minimum bet at this table_max_bet
- the maximum bet at this tableMethod Detail |
---|
public java.lang.String getName()
public int getMaxPlayers()
public DealerStrategy getStrategy()
public int getMinimumBet()
public int getMaximumBet()
public int getNumPlayers()
public boolean hasRoom()
true
if and only if the current number
of blackjack players is less than the maximum number permitted.
true
if more players can be added to the table,
false
otherwisepublic java.util.List<Player> getPlayers()
public boolean addPlayer(Player p)
true
, the table must have room for the player
and the player must not be at a table already. Otherwise, this method
returns false
.
p
- the player to add to the table
true
if the player is added to the table,
false
otherwisepublic boolean removePlayer(Player p)
true
, the player must be at the table
already.
p
- the player to remove from the table
true
if the player is removed from the table,
false
otherwisepublic void playRound()
public void playRounds(int num_rounds)
num_rounds
- the number of blackjack rounds to playpublic ObserverList<TableObserver> getObservers()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |