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:
Ray Greenwell
2006-12-01 02:24:27 +00:00
parent 737bca0a98
commit 06046aed9c
2 changed files with 13 additions and 4 deletions
@@ -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
+12 -1
View File
@@ -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.
*/