Allow the DObject to be set after construction.
git-svn-id: svn+ssh://src.earth.threerings.net/vilya/trunk@849 c613c5cb-e716-0410-b11b-feb51c14d237
This commit is contained in:
@@ -25,6 +25,8 @@ import com.samskivert.util.IntMap;
|
|||||||
import com.samskivert.util.IntMaps;
|
import com.samskivert.util.IntMaps;
|
||||||
import com.samskivert.util.ListUtil;
|
import com.samskivert.util.ListUtil;
|
||||||
|
|
||||||
|
import com.google.common.base.Preconditions;
|
||||||
|
|
||||||
import com.threerings.util.Name;
|
import com.threerings.util.Name;
|
||||||
|
|
||||||
import com.threerings.presents.data.ClientObject;
|
import com.threerings.presents.data.ClientObject;
|
||||||
@@ -76,9 +78,21 @@ public class TableManager
|
|||||||
_invmgr = invmgr;
|
_invmgr = invmgr;
|
||||||
_plreg = plreg;
|
_plreg = plreg;
|
||||||
|
|
||||||
|
if (tableObject != null) {
|
||||||
|
setTableObject(tableObject);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Initialize the TableLobbyObject. Do not call this more than once.
|
||||||
|
*/
|
||||||
|
public void setTableObject (DObject tableObject)
|
||||||
|
{
|
||||||
|
Preconditions.checkState((_tlobj == null), "Already got one!");
|
||||||
|
|
||||||
// set up our object references
|
// set up our object references
|
||||||
_tlobj = (TableLobbyObject)tableObject;
|
_tlobj = (TableLobbyObject)tableObject;
|
||||||
_tlobj.setTableService(invmgr.registerDispatcher(new TableDispatcher(this)));
|
_tlobj.setTableService(_invmgr.registerDispatcher(new TableDispatcher(this)));
|
||||||
_dobj = tableObject;
|
_dobj = tableObject;
|
||||||
|
|
||||||
// if our table is in a "place" add ourselves as a listener so that we can tell if a user
|
// if our table is in a "place" add ourselves as a listener so that we can tell if a user
|
||||||
|
|||||||
Reference in New Issue
Block a user