Checkpoint, I've got an interactive 2d scene mostly working.

git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@4151 542714f4-19e9-0310-aa3c-eee0fc999fb1
This commit is contained in:
Ray Greenwell
2006-05-26 21:54:34 +00:00
parent 9c33f1de53
commit fdfce50d01
20 changed files with 113 additions and 47 deletions
@@ -5,7 +5,7 @@ import mx.collections.ArrayCollection;
import com.threerings.util.HashMap;
import com.threerings.presents.data.ListenerMarshaller;
import com.threerings.presents.data.InvocationMarshaller_ListenerMarshaller;
import com.threerings.presents.dobj.DEvent;
import com.threerings.presents.dobj.DObject;
@@ -138,8 +138,9 @@ public class InvocationDirector
{
// configure any invocation listener marshallers among the args
for each (var arg :Object in args) {
if (arg is ListenerMarshaller) {
var lm :ListenerMarshaller = (arg as ListenerMarshaller);
if (arg is InvocationMarshaller_ListenerMarshaller) {
var lm :InvocationMarshaller_ListenerMarshaller =
(arg as InvocationMarshaller_ListenerMarshaller);
lm.callerOid = _clobj.getOid();
lm.requestId = nextRequestId();
lm.mapStamp = new Date().getTime();
@@ -187,8 +188,8 @@ public class InvocationDirector
protected function handleInvocationResponse
(reqId :int, methodId :int, args :Array) :void
{
var listener :ListenerMarshaller =
(_listeners.remove(reqId) as ListenerMarshaller);
var listener :InvocationMarshaller_ListenerMarshaller =
(_listeners.remove(reqId) as InvocationMarshaller_ListenerMarshaller);
if (listener == null) {
log.warning("Received invocation response for which we have " +
"no registered listener [reqId=" + reqId +
@@ -270,8 +271,8 @@ public class InvocationDirector
{
var then :Number = now - LISTENER_MAX_AGE;
for (var skey :String in _listeners.keys()) {
var lm :ListenerMarshaller =
(_listeners.get(skey) as ListenerMarshaller);
var lm :InvocationMarshaller_ListenerMarshaller =
(_listeners.get(skey) as InvocationMarshaller_ListenerMarshaller);
if (lm.mapStamp < then) {
_listeners.remove(skey);
}
@@ -5,7 +5,8 @@ import com.threerings.presents.client.GotTimeBaseListener;
import com.threerings.presents.dobj.InvocationResponseEvent;
// TODO: this will be autogenerated
public class GotTimeBaseMarshaller extends ListenerMarshaller
public class GotTimeBaseMarshaller
extends InvocationMarshaller_ListenerMarshaller
implements GotTimeBaseListener
{
public static const GOT_TIME_OID :int = 1;
@@ -2,7 +2,8 @@ package com.threerings.presents.data {
import com.threerings.presents.client.ConfirmListener;
public class ConfirmMarshaller extends ListenerMarshaller
public class InvocationMarshaller_ConfirmMarshaller
extends InvocationMarshaller_ListenerMarshaller
implements ConfirmListener
{
public static const REQUEST_PROCESSED :int = 1;
@@ -11,7 +11,7 @@ import com.threerings.presents.client.InvocationListener;
import com.threerings.presents.dobj.DObjectManager;
import com.threerings.presents.dobj.InvocationResponseEvent;
public class ListenerMarshaller
public class InvocationMarshaller_ListenerMarshaller
implements Streamable, InvocationListener
{
/** The method id used to dispatch a requestFailed response. */
@@ -40,8 +40,14 @@ public class CompoundEvent extends DEvent
/**
* Constructs a compound event and prepares it for operation.
*/
public function CompoundEvent (target :DObject, omgr :DObjectManager)
public function CompoundEvent (
target :DObject = null, omgr :DObjectManager = null)
{
if (target == null) {
super();
return;
}
super(target.getOid());
// sanity check
@@ -10,7 +10,7 @@ import com.threerings.util.StringBuilder;
public /* abstract */ class DEvent
implements Streamable
{
public function DEvent (targetOid :int)
public function DEvent (targetOid :int = 0)
{
_toid = targetOid;
}