Add a 'destroyed' signal to generated ActionScript DObjects
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@6389 542714f4-19e9-0310-aa3c-eee0fc999fb1
This commit is contained in:
@@ -32,6 +32,7 @@ public class {{classname}} {{^extends.isEmpty}}extends {{extends}}
|
||||
public var updated{{capitalName}} :Signal = new Signal(int, Object, Object);
|
||||
{{/array}}
|
||||
{{/pubFields}}
|
||||
public var destroyed :Signal = new Signal();
|
||||
|
||||
{{#pubFields}}
|
||||
public static const {{dobjectField}} :String = "{{name}}";
|
||||
@@ -93,12 +94,14 @@ import com.threerings.presents.dobj.ElementUpdateListener;
|
||||
import com.threerings.presents.dobj.EntryAddedEvent;
|
||||
import com.threerings.presents.dobj.EntryRemovedEvent;
|
||||
import com.threerings.presents.dobj.EntryUpdatedEvent;
|
||||
import com.threerings.presents.dobj.ObjectDeathListener;
|
||||
import com.threerings.presents.dobj.ObjectDestroyedEvent;
|
||||
import com.threerings.presents.dobj.SetListener;
|
||||
|
||||
import {{package}}.{{classname}};
|
||||
|
||||
class Signaller
|
||||
implements AttributeChangeListener, SetListener, ElementUpdateListener
|
||||
implements AttributeChangeListener, SetListener, ElementUpdateListener, ObjectDeathListener
|
||||
{
|
||||
public function Signaller (obj :{{classname}})
|
||||
{
|
||||
@@ -181,6 +184,11 @@ class Signaller
|
||||
signal.dispatch(event.getIndex(), event.getValue(), event.getOldValue());
|
||||
}
|
||||
|
||||
public function objectDestroyed (event :ObjectDestroyedEvent) :void
|
||||
{
|
||||
_obj.destroyed.dispatch();
|
||||
}
|
||||
|
||||
protected var _obj :{{classname}};
|
||||
}
|
||||
// GENERATED SIGNALLER END
|
||||
|
||||
Reference in New Issue
Block a user