|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Object | +--org.jogre.common.Table
Server side data object which holds information on various tables and their current users etc.
| Field Summary | |
static int |
NUM_OF_HEADER_TOKENS
Number of tokens which a Player flattens to. |
static String |
TABLE
Header token String. |
| Constructor Summary | |
Table(int tableNumber,
String username,
boolean isPublic)
Create a table and 1 user (owner) |
|
Table(String inString)
Create Table object from a String. |
|
| Method Summary | |
void |
addPlayer(String playerName)
Add a user to the table i.e. |
boolean |
containsUser(String user)
Returns true if a specified user is at a table. |
String |
flatten()
Flatten the table object. |
void |
gameOver()
Game over. |
JogreModel |
getModel()
Retrieve the model from the server (if its being used). |
String |
getModelStr()
Retrieve the model as a String from the server (if its being used). |
String |
getOwner()
Get the owner of this table. |
PlayerList |
getPlayerList()
|
int |
getTableNum()
Get the number of this table. |
boolean |
isGamePlaying()
Return true if a game is in progress. |
boolean |
isModelStateAttached()
Return if the model state is attached or not. |
boolean |
isPublic()
Returns true if this is a public table. |
int |
length()
Return the length (number of tokens in the flatten() methodof this particular |
String |
nextPlayer()
Sets the next player username. |
void |
removePlayer(String player)
Remove a player from the list. |
void |
setModel(JogreModel model)
Set the game data. |
void |
setModelStateAttached(boolean value)
Set true if the model state is to be attached or not. |
String |
toString()
Return the String version of this table. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
public static final String TABLE
public static final int NUM_OF_HEADER_TOKENS
| Constructor Detail |
public Table(int tableNumber,
String username,
boolean isPublic)
tableNumber - The table number of the new table.username - Username (owner).isPublic - boolean to show if a table is public or private.
public Table(String inString)
throws TransmissionException,
NumberFormatException
inString - TransmissionException - Thrown if there is a problem in transmission.NumberFormatException - Problem parsing an int.| Method Detail |
public void addPlayer(String playerName)
playerName - Username of the player.public void removePlayer(String player)
player - Username of the player.public void gameOver()
public int getTableNum()
public PlayerList getPlayerList()
public boolean containsUser(String user)
user - public String getOwner()
public boolean isPublic()
public JogreModel getModel()
public String getModelStr()
public void setModel(JogreModel model)
model - public String nextPlayer()
public void setModelStateAttached(boolean value)
value - public boolean isModelStateAttached()
public int length()
public String flatten()
flatten in interface ITransmittableITransmittable.flatten()public String toString()
toString in class ObjectObject.toString()public boolean isGamePlaying()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||