DSet should be cloneable; ObjectUtil.copy() only works for registered
Externalizables or built-in classes. git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@4464 542714f4-19e9-0310-aa3c-eee0fc999fb1
This commit is contained in:
@@ -21,8 +21,6 @@
|
||||
|
||||
package com.threerings.presents.data {
|
||||
|
||||
import mx.utils.ObjectUtil;
|
||||
|
||||
import com.threerings.presents.dobj.DObject;
|
||||
import com.threerings.presents.dobj.DSet;
|
||||
import com.threerings.presents.dobj.DSet_Entry;
|
||||
@@ -79,7 +77,7 @@ public class ClientObject extends DObject
|
||||
{
|
||||
requestAttributeChange(RECEIVERS, value, this.receivers);
|
||||
this.receivers = (value == null) ? null
|
||||
: (ObjectUtil.copy(value) as DSet);
|
||||
: (value.clone() as DSet);
|
||||
}
|
||||
// AUTO-GENERATED: METHODS END
|
||||
|
||||
|
||||
@@ -3,6 +3,7 @@ package com.threerings.presents.dobj {
|
||||
import mx.utils.ObjectUtil;
|
||||
|
||||
import com.threerings.util.ArrayIterator;
|
||||
import com.threerings.util.Cloneable;
|
||||
import com.threerings.util.Equalable;
|
||||
import com.threerings.util.Iterator;
|
||||
import com.threerings.util.StringBuilder;
|
||||
@@ -32,7 +33,7 @@ import com.threerings.io.TypedArray;
|
||||
* a {@link Streamable} type.
|
||||
*/
|
||||
public class DSet
|
||||
implements Streamable
|
||||
implements Cloneable, Streamable
|
||||
{
|
||||
/**
|
||||
* Returns the number of entries in this set.
|
||||
@@ -189,6 +190,16 @@ public class DSet
|
||||
return null;
|
||||
}
|
||||
|
||||
// from interface Cloneable
|
||||
public function clone () :Object
|
||||
{
|
||||
var other :DSet = new DSet();
|
||||
for each (var val :DSet_Entry in _entries) {
|
||||
other._entries.push(val);
|
||||
}
|
||||
return other;
|
||||
}
|
||||
|
||||
/**
|
||||
* Generates a string representation of this set instance.
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user