|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.threerings.parlor.data.Table
public class Table
This class represents a table that is being used to matchmake a game by the Parlor services.
| Nested Class Summary |
|---|
| Nested classes/interfaces inherited from interface com.threerings.io.Streamable |
|---|
com.threerings.io.Streamable.Closure |
| Field Summary | |
|---|---|
static int |
ANY_POSITION
Used to request any position at a table. |
int[] |
bodyOids
The body oids of the players of this table, or null if a party game. |
GameConfig |
config
The game config for the game that is being matchmade. |
int |
gameOid
The oid of the game that was created from this table or -1 if the table is still in matchmaking mode. |
int |
lobbyOid
The object id of the lobby object with which this table is associated. |
com.threerings.util.Name[] |
players
An array of the usernames of the players of this table (some slots may not be filled), or null if a party game. |
int |
tableId
The unique identifier for this table. |
TableConfig |
tconfig
The table configuration object. |
com.threerings.util.Name[] |
watchers
An array of the usernames of the non-player occupants of this game. |
| Fields inherited from interface com.threerings.parlor.data.ParlorCodes |
|---|
ALREADY_AT_TABLE, BANNED_FROM_TABLE, GAME_ALREADY_STARTED, INVALID_TABLE_POSITION, INVITATION_ACCEPTED, INVITATION_COUNTERED, INVITATION_REFUSED, INVITEE_NOT_ONLINE, MUST_BE_CREATOR, NO_SELF_BOOT, NO_SUCH_TABLE, NOT_AT_TABLE, PARLOR_GROUP, TABLE_POSITION_OCCUPIED |
| Fields inherited from interface com.threerings.presents.data.InvocationCodes |
|---|
ACCESS_DENIED, E_ACCESS_DENIED, E_INTERNAL_ERROR, GLOBAL_GROUP, INTERNAL_ERROR |
| Constructor Summary | |
|---|---|
Table()
Constructs a blank table instance, suitable for unserialization. |
|
| Method Summary | |
|---|---|
void |
addBannedUser(com.threerings.util.Name player)
Indicate to this table that a user was booted and should be prevented from rejoining. |
boolean |
clearPlayer(com.threerings.util.Name username)
Requests that the specified user be removed from their seat at this table. |
boolean |
clearPlayerByOid(int bodyOid)
Requests that the user identified by the specified body object id be removed from their seat at this table. |
void |
clearPlayerPos(int position)
Called to clear a player at the specified position. |
boolean |
containsPlayer(com.threerings.util.Name player)
Returns true if this table contains the specified player. |
boolean |
equals(Object other)
|
Comparable<?> |
getKey()
|
int |
getOccupiedCount()
Count the number of players currently occupying this table. |
com.threerings.util.Name[] |
getPlayers()
Once a table is ready to play (see mayBeStarted() and shouldBeStarted()), the
players array can be fetched using this method. |
int[][] |
getTeamMemberIndices()
For a team game, get the team member indices of the compressed players array returned by getPlayers(). |
int |
hashCode()
|
void |
init(int lobbyOid,
TableConfig tconfig,
GameConfig config)
Initializes a new table instance, and assigns it the next monotonically increasing table id. |
boolean |
inPlay()
Returns true if this table is in play, false if it is still being matchmade. |
boolean |
isEmpty()
Returns true if there is no one sitting at this table. |
boolean |
mayBeStarted()
Returns true if this table has a sufficient number of players that the game can be started. |
String |
setPlayer(int position,
com.threerings.crowd.data.BodyObject player)
Requests to seat the specified user at the specified position in this table. |
void |
setPlayerPos(int position,
com.threerings.crowd.data.BodyObject player)
This method is used for party games, it does no bounds checking or verification of the player's ability to join, if you are unsure you should call 'setPlayer'. |
boolean |
shouldBeStarted()
Returns true if sufficient seats are occupied that the game should be automatically started. |
String |
toString()
|
void |
updateOccupants(GameObject gameobj)
Called by the table manager when the game object's players have changed. |
| Methods inherited from class java.lang.Object |
|---|
getClass, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
public static final int ANY_POSITION
public int tableId
public int lobbyOid
public int gameOid
public com.threerings.util.Name[] players
public com.threerings.util.Name[] watchers
public transient int[] bodyOids
public GameConfig config
public TableConfig tconfig
| Constructor Detail |
|---|
public Table()
| Method Detail |
|---|
public void init(int lobbyOid,
TableConfig tconfig,
GameConfig config)
lobbyOid - the object id of the lobby in which this table is to live.tconfig - the table configuration for this table.config - the configuration of the game being matchmade by this table.public boolean isEmpty()
public int getOccupiedCount()
public com.threerings.util.Name[] getPlayers()
mayBeStarted() and shouldBeStarted()), the
players array can be fetched using this method. It will return an array containing the
usernames of all of the players in the game, sized properly and with each player in the
appropriate position.
public int[][] getTeamMemberIndices()
getPlayers().
public String setPlayer(int position,
com.threerings.crowd.data.BodyObject player)
position - the position in which to seat the user.player - the player to set.
public void setPlayerPos(int position,
com.threerings.crowd.data.BodyObject player)
public void addBannedUser(com.threerings.util.Name player)
public boolean clearPlayer(com.threerings.util.Name username)
public boolean clearPlayerByOid(int bodyOid)
public void clearPlayerPos(int position)
public boolean containsPlayer(com.threerings.util.Name player)
public void updateOccupants(GameObject gameobj)
watchers array.
public boolean mayBeStarted()
public boolean shouldBeStarted()
public boolean inPlay()
public Comparable<?> getKey()
getKey in interface com.threerings.presents.dobj.DSet.Entrypublic boolean equals(Object other)
equals in class Objectpublic int hashCode()
hashCode in class Objectpublic String toString()
toString in class Object
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||