|
Jadex 0.96 | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjadex.examples.blackjack.Player
public class Player
Representation of a player.
Field Summary | |
---|---|
SimplePropertyChangeSupport |
pcs
The helper object for bean events. |
static String |
STATE_FINISHED
State of a player when all cards are drawn. |
static String |
STATE_GAME_STARTED
State of a player at game start. |
static String |
STATE_IDLE
State of a player that is not involved in a game. |
static String |
STATE_PLAYING
State of a player, after bet is made. |
static String |
STATE_UNREGISTERED
. |
Constructor Summary | |
---|---|
Player()
Empty bean constructor. |
|
Player(AgentIdentifier aid,
String name,
int account,
Color color,
String strategyname)
Create a new Player. |
|
Player(String name,
int account,
Color color,
String strategyname)
Create a new Player. |
Method Summary | |
---|---|
void |
addCard(Card card)
Add a card. |
void |
addPropertyChangeListener(PropertyChangeListener listener)
Add a PropertyChangeListener to the listener list. |
boolean |
equals(Object o)
Test if this player equals another object. |
int |
getAccount()
Get the account of the player. |
BasicAgentIdentifier |
getAgentID()
Get the aid of the player. |
int |
getBet()
Get the bet. |
Card |
getCard(int idx)
Get a card. |
Card[] |
getCards()
Get the cards held by the player. |
Color |
getColor()
Get the color of the player. |
int |
getColorValue()
Get the color value. |
int |
getGameCount()
Get the game counter. |
int |
getMoneyWon(Card[] dealercards)
Get the money won in the current game. |
String |
getName()
Get the name of the player. |
String |
getState()
Get the state. |
IStrategy |
getStrategy()
Get the strategy of the player. |
String |
getStrategyName()
Get the strategy name. |
int |
hashCode()
Get the hash code of this player. |
void |
makeBet(int bet)
Make a bet. |
void |
removePropertyChangeListener(PropertyChangeListener listener)
Remove a PropertyChangeListener from the listener list. |
void |
setAccount(int account)
Set the account of the player. |
void |
setAgentID(BasicAgentIdentifier aid)
Set the aid of the player. |
void |
setBet(int bet)
Set the bet. |
void |
setCard(int idx,
Card card)
Get a card. |
void |
setCards(Card[] cards)
Get the cards held by the player. |
void |
setColor(Color color)
Set the color of the player. |
void |
setColorValue(int colorvalue)
Set the color value. |
void |
setName(String name)
Set the name of the player. |
void |
setState(String state)
Set the state. |
void |
setStrategy(IStrategy strategy)
Set the strategy of the player. |
void |
setStrategyName(String strategyname)
Set the strategy name. |
String |
toString()
|
Methods inherited from class java.lang.Object |
---|
getClass, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public static final String STATE_UNREGISTERED
public static final String STATE_IDLE
public static final String STATE_GAME_STARTED
public static final String STATE_PLAYING
public static final String STATE_FINISHED
public SimplePropertyChangeSupport pcs
Constructor Detail |
---|
public Player()
public Player(String name, int account, Color color, String strategyname)
public Player(AgentIdentifier aid, String name, int account, Color color, String strategyname)
Method Detail |
---|
public String getName()
public void setName(String name)
public int getAccount()
public void setAccount(int account)
public Color getColor()
public void setColor(Color color)
public int getColorValue()
public void setColorValue(int colorvalue)
colorvalue
- The color value.public IStrategy getStrategy()
public void setStrategy(IStrategy strategy)
public String getStrategyName()
public void setStrategyName(String strategyname)
strategyname
- The strategy name.public BasicAgentIdentifier getAgentID()
public void setAgentID(BasicAgentIdentifier aid)
public void addCard(Card card)
public Card[] getCards()
public void setCards(Card[] cards)
public Card getCard(int idx)
public void setCard(int idx, Card card)
public String getState()
public void setState(String state)
public int getBet()
public void setBet(int bet)
public void makeBet(int bet)
public int getGameCount()
public int getMoneyWon(Card[] dealercards)
public boolean equals(Object o)
equals
in class Object
public int hashCode()
hashCode
in class Object
public String toString()
toString
in class Object
public void addPropertyChangeListener(PropertyChangeListener listener)
listener
- The PropertyChangeListener to be added.public void removePropertyChangeListener(PropertyChangeListener listener)
listener
- The PropertyChangeListener to be removed.
|
Jadex 0.96 | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Copyright (C) 2002-2007 Lars Braubach, Alexander Pokahr - University of Hamburg. Use is subject to license terms.