public class TableDirector extends com.threerings.presents.client.BasicDirector implements com.threerings.presents.dobj.SetListener<Table>, com.threerings.presents.client.InvocationService.ResultListener
TableLobbyController or something similar, we instead provide
the table director which can be instantiated by the place controller (or specific table related
views) to handle the table matchmaking services.
Entites that do so, will need to implement the TableObserver interface so that the
table director can notify them when table related things happen.
The table services expect that the place object being used as a lobby in which the table
matchmaking takes place implements the TableLobbyObject interface.
| Constructor and Description |
|---|
TableDirector(ParlorContext ctx,
String tableField,
TableObserver observer)
Creates a new table director to manage tables with the specified observer which will receive
callbacks when interesting table related things happen.
|
| Modifier and Type | Method and Description |
|---|---|
void |
addSeatednessObserver(SeatednessObserver observer)
Requests that the specified observer be added to the list of observers that are notified
when this client sits down at or stands up from a table.
|
void |
bootPlayer(int tableId,
com.threerings.util.Name target)
Sends a request to boot a player from a table.
|
void |
clearTableObject()
This must be called by the entity that uses the table director when the using entity has
left and is done dealing with tables.
|
void |
clientDidLogoff(com.threerings.presents.client.Client client) |
void |
createTable(TableConfig tableConfig,
GameConfig config)
Sends a request to create a table with the specified game configuration.
|
void |
entryAdded(com.threerings.presents.dobj.EntryAddedEvent<Table> event) |
void |
entryRemoved(com.threerings.presents.dobj.EntryRemovedEvent<Table> event) |
void |
entryUpdated(com.threerings.presents.dobj.EntryUpdatedEvent<Table> event) |
Table |
getSeatedTable()
Returns the current table this client is seated at, or null.
|
boolean |
isSeated()
Returns true if this client is currently seated at a table, false if they are not.
|
void |
joinTable(int tableId,
int position)
Sends a request to join the specified table at the specified position.
|
void |
leaveTable(int tableId)
Sends a request to leave the specified table at which we are presumably seated.
|
void |
removeSeatednessObserver(SeatednessObserver observer)
Requests that the specified observer be removed from to the list of observers that are
notified when this client sits down at or stands up from a table.
|
void |
requestFailed(String reason) |
void |
requestProcessed(Object result) |
void |
setTableObject(com.threerings.presents.dobj.DObject tlobj)
This must be called by the entity that uses the table director when the using entity
prepares to enter and display a place.
|
void |
startTableNow(int tableId)
Sends a request to have the specified table start now, even if all the seats have not yet
been filled.
|
public TableDirector(ParlorContext ctx, String tableField, TableObserver observer)
ctx - the parlor context in use by the client.tableField - the field name of the distributed set that contains the tables we will be
managing.observer - the entity that will receive callbacks when things happen to the tables.public void setTableObject(com.threerings.presents.dobj.DObject tlobj)
public void clearTableObject()
public void addSeatednessObserver(SeatednessObserver observer)
public void removeSeatednessObserver(SeatednessObserver observer)
public boolean isSeated()
public Table getSeatedTable()
public void createTable(TableConfig tableConfig, GameConfig config)
TableObserver interface.public void joinTable(int tableId,
int position)
TableObserver interface.public void leaveTable(int tableId)
TableObserver interface.public void startTableNow(int tableId)
public void bootPlayer(int tableId,
com.threerings.util.Name target)
public void clientDidLogoff(com.threerings.presents.client.Client client)
clientDidLogoff in interface com.threerings.presents.client.SessionObserverclientDidLogoff in class com.threerings.presents.client.BasicDirectorpublic void entryAdded(com.threerings.presents.dobj.EntryAddedEvent<Table> event)
entryAdded in interface com.threerings.presents.dobj.SetListener<Table>public void entryUpdated(com.threerings.presents.dobj.EntryUpdatedEvent<Table> event)
entryUpdated in interface com.threerings.presents.dobj.SetListener<Table>public void entryRemoved(com.threerings.presents.dobj.EntryRemovedEvent<Table> event)
entryRemoved in interface com.threerings.presents.dobj.SetListener<Table>public void requestProcessed(Object result)
requestProcessed in interface com.threerings.presents.client.InvocationService.ResultListenerpublic void requestFailed(String reason)
requestFailed in interface com.threerings.presents.client.InvocationService.InvocationListenerCopyright © 2015. All rights reserved.