diff --git a/src/main/as/com/threerings/presents/dobj/ObjectDeathAdapter.as b/src/main/as/com/threerings/presents/dobj/ObjectDeathAdapter.as
new file mode 100644
index 000000000..9361dcf4d
--- /dev/null
+++ b/src/main/as/com/threerings/presents/dobj/ObjectDeathAdapter.as
@@ -0,0 +1,49 @@
+//
+// $Id$
+//
+// Narya library - tools for developing networked games
+// Copyright (C) 2002-2011 Three Rings Design, Inc., All Rights Reserved
+// http://code.google.com/p/narya/
+//
+// This library is free software; you can redistribute it and/or modify it
+// under the terms of the GNU Lesser General Public License as published
+// by the Free Software Foundation; either version 2.1 of the License, or
+// (at your option) any later version.
+//
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+
+package com.threerings.presents.dobj {
+
+/**
+ * An object death listener that delegates to a callback function.
+ */
+public class ObjectDeathAdapter
+ implements ObjectDeathListener
+{
+ /**
+ * Create a new adapter that delegates to the given callback function. The function should
+ * match the signature of the ObjectDeathListener's objectDestroyed method:
+ *
+ * function objectDestroyed (event :ObjectDestroyedEvent) :void;
+ *
+ */
+ public function ObjectDeathAdapter (callback :Function)
+ {
+ _callback = callback;
+ }
+
+ public function objectDestroyed (event :ObjectDestroyedEvent) :void
+ {
+ _callback(event);
+ }
+
+ protected var _callback :Function;
+}
+}
\ No newline at end of file
diff --git a/src/main/as/com/threerings/presents/util/SafeObjectManager.as b/src/main/as/com/threerings/presents/util/SafeObjectManager.as
index b3bb1553a..5efec2ed7 100644
--- a/src/main/as/com/threerings/presents/util/SafeObjectManager.as
+++ b/src/main/as/com/threerings/presents/util/SafeObjectManager.as
@@ -22,13 +22,14 @@
package com.threerings.presents.util {
import flash.utils.Dictionary;
+
+import com.threerings.util.Log;
+
import com.threerings.presents.dobj.DObject;
import com.threerings.presents.dobj.DObjectManager;
import com.threerings.presents.dobj.ObjectAccessError;
-import com.threerings.presents.dobj.ObjectDeathListener;
+import com.threerings.presents.dobj.ObjectDeathAdapter;
import com.threerings.presents.dobj.ObjectDestroyedEvent;
-import com.threerings.presents.dobj.SubscriberAdapter;
-import com.threerings.util.Log;
/**
* Safely manages subscriptions and provides access to objects.
@@ -208,14 +209,12 @@ public class SafeObjectManager
protected var _log :Log;
protected var _available :Function;
protected var _failed :Function;
- protected var _odlist :ObjectDeathListenerAdapter = new ObjectDeathListenerAdapter(destroyed);
+ protected var _odlist :ObjectDeathAdapter = new ObjectDeathAdapter(destroyed);
protected var _entries :Dictionary = new Dictionary();
}
}
import com.threerings.presents.dobj.DObject;
-import com.threerings.presents.dobj.ObjectDeathListener;
-import com.threerings.presents.dobj.ObjectDestroyedEvent;
import com.threerings.presents.util.SafeSubscriber;
class Entry
@@ -232,19 +231,3 @@ class Entry
sub = subscriber;
}
}
-
-class ObjectDeathListenerAdapter
- implements ObjectDeathListener
-{
- public var callback :Function;
-
- public function ObjectDeathListenerAdapter (callback :Function)
- {
- this.callback = callback;
- }
-
- public function objectDestroyed (event :ObjectDestroyedEvent) :void
- {
- callback(event);
- }
-}