|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectbluegammon.logic.Player
Abstract class for a player. Contains generic functionality and
has helper methods for sending events to any PlayerListener
.
Constructor Summary | |
Player()
|
Method Summary | |
void |
addListener(PlayerListener listener)
Adds a listener to this player. |
int |
getId()
Returns the id of this player. |
char[] |
getName()
Returns the name of this player. |
void |
init(int id,
char[] name,
boolean white)
Initializes this player. |
boolean |
isWhite()
Returns the color of this player. |
void |
setWhite(boolean white)
Sets the color of the player. |
Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public Player()
Method Detail |
public void init(int id, char[] name, boolean white)
id
- The id of the player.name
- The name of the player.white
- The color of the player, true for white, false for black.public void setWhite(boolean white)
white
- True for white, false for black.public int getId()
public char[] getName()
public boolean isWhite()
public void addListener(PlayerListener listener)
listener
- The listener to add.
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |