Wrapped -> Boxed.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@5195 542714f4-19e9-0310-aa3c-eee0fc999fb1
This commit is contained in:
@@ -24,9 +24,9 @@ package com.threerings.presents.client {
|
||||
import flash.errors.IllegalOperationError;
|
||||
import flash.utils.getTimer; // function import
|
||||
|
||||
import com.threerings.util.Boxed;
|
||||
import com.threerings.util.HashMap;
|
||||
import com.threerings.util.Log;
|
||||
import com.threerings.util.Wrapped;
|
||||
|
||||
import com.threerings.presents.data.InvocationMarshaller_ListenerMarshaller;
|
||||
|
||||
@@ -243,7 +243,7 @@ public class InvocationDirector
|
||||
return;
|
||||
}
|
||||
|
||||
unwrapArgs(args);
|
||||
unboxArgs(args);
|
||||
|
||||
// log.info("Dispatching invocation response [listener=" + listener +
|
||||
// ", methId=" + methodId + ", args=" + StringUtil.toString(args) + "].");
|
||||
@@ -280,7 +280,7 @@ public class InvocationDirector
|
||||
return;
|
||||
}
|
||||
|
||||
unwrapArgs(args);
|
||||
unboxArgs(args);
|
||||
|
||||
// log.info("Dispatching invocation notification [receiver=" + decoder.receiver +
|
||||
// ", methodId=" + methodId + ", args=" + StringUtil.toString(args) + "].");
|
||||
@@ -326,14 +326,14 @@ public class InvocationDirector
|
||||
}
|
||||
|
||||
/**
|
||||
* Unwrap any arguments that have arrived from the server in wrapped types.
|
||||
* Unbox any arguments that have arrived from the server in boxed types.
|
||||
*/
|
||||
protected function unwrapArgs (args :Array) :void
|
||||
protected function unboxArgs (args :Array) :void
|
||||
{
|
||||
if (args != null) {
|
||||
for (var ii :int = 0; ii < args.length; ii++) {
|
||||
if (args[ii] is Wrapped) {
|
||||
args[ii] = (args[ii] as Wrapped).unwrap();
|
||||
if (args[ii] is Boxed) {
|
||||
args[ii] = (args[ii] as Boxed).unbox();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -21,7 +21,7 @@
|
||||
|
||||
package com.threerings.presents.data {
|
||||
|
||||
import com.threerings.util.Wrapped;
|
||||
import com.threerings.util.Boxed;
|
||||
|
||||
import com.threerings.presents.client.InvocationService_ResultListener;
|
||||
|
||||
@@ -36,8 +36,8 @@ public class InvocationMarshaller_ResultMarshaller
|
||||
switch (methodId) {
|
||||
case REQUEST_PROCESSED:
|
||||
var result :Object = args[0];
|
||||
if (result is Wrapped) {
|
||||
result = (result as Wrapped).unwrap();
|
||||
if (result is Boxed) {
|
||||
result = (result as Boxed).unbox();
|
||||
}
|
||||
(listener as InvocationService_ResultListener).requestProcessed(
|
||||
result);
|
||||
|
||||
@@ -24,8 +24,8 @@ package com.threerings.presents.dobj {
|
||||
import com.threerings.io.ObjectInputStream;
|
||||
import com.threerings.io.ObjectOutputStream;
|
||||
|
||||
import com.threerings.util.Boxed;
|
||||
import com.threerings.util.StringBuilder;
|
||||
import com.threerings.util.Wrapped;
|
||||
|
||||
/**
|
||||
* An attribute changed event is dispatched when a single attribute of a
|
||||
@@ -126,8 +126,8 @@ public class AttributeChangedEvent extends NamedEvent
|
||||
_value = ins.readObject();
|
||||
|
||||
// possibly convert the value
|
||||
if (_value is Wrapped) {
|
||||
_value = (_value as Wrapped).unwrap();
|
||||
if (_value is Boxed) {
|
||||
_value = (_value as Boxed).unbox();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -234,6 +234,12 @@ public class DSet
|
||||
// documentation inherited from interface Streamable
|
||||
public function writeObject (out :ObjectOutputStream) :void
|
||||
{
|
||||
if (_entries.length > 0) {
|
||||
Log.getLog(this).warning("Error! We can't send DSets back to the server until we " +
|
||||
"fix up the actionscript implementation!");
|
||||
Log.dumpStack();
|
||||
}
|
||||
|
||||
out.writeInt(_entries.length);
|
||||
for (var ii :int = 0; ii < _entries.length; ii++) {
|
||||
out.writeObject(_entries[ii]);
|
||||
|
||||
@@ -24,8 +24,8 @@ package com.threerings.presents.dobj {
|
||||
import com.threerings.io.ObjectInputStream;
|
||||
import com.threerings.io.ObjectOutputStream;
|
||||
|
||||
import com.threerings.util.Boxed;
|
||||
import com.threerings.util.StringBuilder;
|
||||
import com.threerings.util.Wrapped;
|
||||
|
||||
/**
|
||||
* An element updated event is dispatched when an element of an array
|
||||
@@ -118,8 +118,8 @@ public class ElementUpdatedEvent extends NamedEvent
|
||||
_value = ins.readObject();
|
||||
_index = ins.readInt();
|
||||
|
||||
if (_value is Wrapped) {
|
||||
_value = (_value as Wrapped).unwrap();
|
||||
if (_value is Boxed) {
|
||||
_value = (_value as Boxed).unbox();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -24,9 +24,9 @@ package com.threerings.presents.dobj {
|
||||
import com.threerings.io.ObjectInputStream;
|
||||
import com.threerings.io.ObjectOutputStream;
|
||||
|
||||
import com.threerings.util.Boxed;
|
||||
import com.threerings.util.Log;
|
||||
import com.threerings.util.StringBuilder;
|
||||
import com.threerings.util.Wrapped;
|
||||
|
||||
/**
|
||||
* An entry removed event is dispatched when an entry is removed from a
|
||||
@@ -125,8 +125,8 @@ public class EntryRemovedEvent extends NamedEvent
|
||||
super.readObject(ins);
|
||||
_key = ins.readObject();
|
||||
|
||||
if (_key is Wrapped) {
|
||||
_key = (_key as Wrapped).unwrap();
|
||||
if (_key is Boxed) {
|
||||
_key = (_key as Boxed).unbox();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -25,8 +25,8 @@ import com.threerings.io.ObjectInputStream;
|
||||
import com.threerings.io.ObjectOutputStream;
|
||||
import com.threerings.io.TypedArray;
|
||||
|
||||
import com.threerings.util.Boxed;
|
||||
import com.threerings.util.StringBuilder;
|
||||
import com.threerings.util.Wrapped;
|
||||
|
||||
/**
|
||||
* A message event is used to dispatch a message to all subscribers of a
|
||||
@@ -119,8 +119,8 @@ public class MessageEvent extends NamedEvent
|
||||
|
||||
if (_args != null) {
|
||||
for (var ii :int = _args.length - 1; ii >= 0; ii--) {
|
||||
if (_args[ii] is Wrapped) {
|
||||
_args[ii] = (_args[ii] as Wrapped).unwrap();
|
||||
if (_args[ii] is Boxed) {
|
||||
_args[ii] = (_args[ii] as Boxed).unbox();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user