diff --git a/src/as/com/threerings/crowd/data/ManagerCaller.as b/src/as/com/threerings/crowd/data/ManagerCaller.as new file mode 100644 index 000000000..44fe73937 --- /dev/null +++ b/src/as/com/threerings/crowd/data/ManagerCaller.as @@ -0,0 +1,24 @@ +// +// $Id$ + +package com.threerings.crowd.data { + +public class ManagerCaller +{ + public function ManagerCaller (plobj :PlaceObject) + { + _plobj = plobj; + } + + /** + * Called to call a method on the manager. + */ + public function invoke (method :String, ... args) :void + { + _plobj.postMessage(method, args); + } + + /** The place object we're thingy-ing for. */ + protected var _plobj :PlaceObject; +} +} diff --git a/src/as/com/threerings/crowd/data/PlaceObject.as b/src/as/com/threerings/crowd/data/PlaceObject.as index a2d0abf43..cf6cff12a 100644 --- a/src/as/com/threerings/crowd/data/PlaceObject.as +++ b/src/as/com/threerings/crowd/data/PlaceObject.as @@ -54,6 +54,11 @@ public class PlaceObject extends DObject public static const SPEAK_SERVICE :String = "speakService"; // AUTO-GENERATED: FIELDS END + /** + * Allows the client to call methods on the manager. + */ + public var manager :ManagerCaller; + /** * Tracks the oid of the body objects of all of the occupants of this * place. @@ -76,6 +81,16 @@ public class PlaceObject extends DObject /** Used to generate speak requests on this place object. */ public var speakService :SpeakMarshaller; + /** + * We need a constructor here in actionscript to set up the + * ManagerCaller. + */ + public function PlaceObject () + { + super(); + manager = new ManagerCaller(this); + } + /** * Looks up a user's occupant info by name. *