From 2ec786bb63c10f75439cf5089e73f5416ca4be15 Mon Sep 17 00:00:00 2001 From: Ray Greenwell Date: Thu, 4 Jun 2009 02:05:52 +0000 Subject: [PATCH] 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 --- .../threerings/parlor/server/TableManager.java | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/src/java/com/threerings/parlor/server/TableManager.java b/src/java/com/threerings/parlor/server/TableManager.java index a585e084..d368c987 100644 --- a/src/java/com/threerings/parlor/server/TableManager.java +++ b/src/java/com/threerings/parlor/server/TableManager.java @@ -25,6 +25,8 @@ import com.samskivert.util.IntMap; import com.samskivert.util.IntMaps; import com.samskivert.util.ListUtil; +import com.google.common.base.Preconditions; + import com.threerings.util.Name; import com.threerings.presents.data.ClientObject; @@ -76,9 +78,21 @@ public class TableManager _invmgr = invmgr; _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 _tlobj = (TableLobbyObject)tableObject; - _tlobj.setTableService(invmgr.registerDispatcher(new TableDispatcher(this))); + _tlobj.setTableService(_invmgr.registerDispatcher(new TableDispatcher(this))); _dobj = tableObject; // if our table is in a "place" add ourselves as a listener so that we can tell if a user