|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--org.jogre.common.PlayerList
This class contains a list of Player object.s
Field Summary | |
protected static int |
NUM_OF_HEADER_TOKENS
Number of header tokens. |
protected static int |
NUM_OF_TOKENS
Number of tokens which a PlayerList flattens to. |
static String |
PLAYER_LIST
Header token String. |
Constructor Summary | |
PlayerList()
Default constructor |
|
PlayerList(String inString)
|
Method Summary | |
void |
addPlayer(String playerName)
Add a player to the table. |
boolean |
containsUser(String player)
Return true if the list contains the player. |
String |
flatten()
Flatten the String so that it can be transmitted. |
Player |
getCurrentPlayer()
Current player as an object |
String |
getCurrentPlayerName()
Return the currrent player if a turned based game. |
String |
getOwner()
Return the owner of this table. |
Player |
getPlayer(int seatNum)
Return a player from a seat number. |
Player |
getPlayer(String playerName)
Return a player. |
Vector |
getPlayers()
Return a vector of players which arn't sorted. |
Vector |
getPlayersSortedByName()
Return a vector of all the players in this list which are sorted by name (used for visual lists etc). |
Vector |
getPlayersSortedBySeat()
Return a vector of all the players in this list which are sorted by seat number (used for the game logic). |
Vector |
getPlayersSortedBySeat(int state)
Return a vector of all the players in this list which are currently actually playing a game. |
int |
getPlayerStateCount(int state)
Returns the number of players in a particular state. |
boolean |
isSeatFree(int seatNum)
Return true if a seat at a table is free. |
int |
length()
Number of tokens. |
void |
nextPlayer()
Makes the current player equal to the next player. |
void |
removePlayer(String player)
Remove a player. |
void |
resetCurrentPlayer()
Sets the current player to the person with the smallest seat number. |
int |
size()
Return the number of users playing at a particular table. |
String |
toString()
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
public static final String PLAYER_LIST
protected static final int NUM_OF_HEADER_TOKENS
protected static final int NUM_OF_TOKENS
Constructor Detail |
public PlayerList()
public PlayerList(String inString) throws TransmissionException
inString
- TransmissionException
- NumberFormatException
- Method Detail |
public void addPlayer(String playerName)
playerName
- Name of the player to add to table.public void removePlayer(String player)
player
- Name of player to remove.public int size()
public boolean containsUser(String player)
player
- public String getOwner()
public Player getPlayer(String playerName)
playerName
- public Player getPlayer(int seatNum)
seatNum
- Seat number of a user.public Vector getPlayers()
public void nextPlayer()
public void resetCurrentPlayer()
public String getCurrentPlayerName()
public Player getCurrentPlayer()
public Vector getPlayersSortedByName()
public Vector getPlayersSortedBySeat(int state)
state
- State of the player e.g. game in statepublic Vector getPlayersSortedBySeat()
public int getPlayerStateCount(int state)
state
- public boolean isSeatFree(int seatNum)
seatNum
- Seat number to check.public int length()
public String flatten()
flatten
in interface ITransmittable
ITransmittable.flatten()
public String toString()
toString
in class Object
Object.toString()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |