diff --git a/build.xml b/build.xml index 0c4c7d42..3f57bd3e 100644 --- a/build.xml +++ b/build.xml @@ -251,7 +251,6 @@ - @@ -263,7 +262,6 @@ - diff --git a/src/as/com/threerings/stage/client/StageSceneService.as b/src/as/com/threerings/stage/client/StageSceneService.as new file mode 100644 index 00000000..b83fe3f6 --- /dev/null +++ b/src/as/com/threerings/stage/client/StageSceneService.as @@ -0,0 +1,41 @@ +// +// $Id$ +// +// Vilya library - tools for developing networked games +// Copyright (C) 2002-2010 Three Rings Design, Inc., All Rights Reserved +// http://www.threerings.net/code/vilya/ +// +// This library is free software; you can redistribute it and/or modify it +// under the terms of the GNU Lesser General Public License as published +// by the Free Software Foundation; either version 2.1 of the License, or +// (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// Lesser General Public License for more details. +// +// You should have received a copy of the GNU Lesser General Public +// License along with this library; if not, write to the Free Software +// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +package com.threerings.stage.client { + +import com.threerings.io.TypedArray; +import com.threerings.miso.data.ObjectInfo; +import com.threerings.presents.client.Client; +import com.threerings.presents.client.InvocationService; +import com.threerings.presents.client.InvocationService_ConfirmListener; + +/** + * An ActionScript version of the Java StageSceneService interface. + */ +public interface StageSceneService extends InvocationService +{ + // from Java interface StageSceneService + function addObject (arg1 :ObjectInfo, arg2 :InvocationService_ConfirmListener) :void; + + // from Java interface StageSceneService + function removeObjects (arg1 :TypedArray /* of class com.threerings.miso.data.ObjectInfo */, arg2 :InvocationService_ConfirmListener) :void; +} +} diff --git a/src/as/com/threerings/stage/data/StageSceneMarshaller.as b/src/as/com/threerings/stage/data/StageSceneMarshaller.as new file mode 100644 index 00000000..50566732 --- /dev/null +++ b/src/as/com/threerings/stage/data/StageSceneMarshaller.as @@ -0,0 +1,68 @@ +// +// $Id$ +// +// Vilya library - tools for developing networked games +// Copyright (C) 2002-2010 Three Rings Design, Inc., All Rights Reserved +// http://www.threerings.net/code/vilya/ +// +// This library is free software; you can redistribute it and/or modify it +// under the terms of the GNU Lesser General Public License as published +// by the Free Software Foundation; either version 2.1 of the License, or +// (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// Lesser General Public License for more details. +// +// You should have received a copy of the GNU Lesser General Public +// License along with this library; if not, write to the Free Software +// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +package com.threerings.stage.data { + +import com.threerings.io.TypedArray; +import com.threerings.miso.data.ObjectInfo; +import com.threerings.presents.client.Client; +import com.threerings.presents.client.InvocationService_ConfirmListener; +import com.threerings.presents.data.InvocationMarshaller; +import com.threerings.presents.data.InvocationMarshaller_ConfirmMarshaller; +import com.threerings.stage.client.StageSceneService; + +/** + * Provides the implementation of the StageSceneService interface + * that marshalls the arguments and delivers the request to the provider + * on the server. Also provides an implementation of the response listener + * interfaces that marshall the response arguments and deliver them back + * to the requesting client. + */ +public class StageSceneMarshaller extends InvocationMarshaller + implements StageSceneService +{ + /** The method id used to dispatch addObject requests. */ + public static const ADD_OBJECT :int = 1; + + // from interface StageSceneService + public function addObject (arg1 :ObjectInfo, arg2 :InvocationService_ConfirmListener) :void + { + var listener2 :InvocationMarshaller_ConfirmMarshaller = new InvocationMarshaller_ConfirmMarshaller(); + listener2.listener = arg2; + sendRequest(ADD_OBJECT, [ + arg1, listener2 + ]); + } + + /** The method id used to dispatch removeObjects requests. */ + public static const REMOVE_OBJECTS :int = 2; + + // from interface StageSceneService + public function removeObjects (arg1 :TypedArray /* of class com.threerings.miso.data.ObjectInfo */, arg2 :InvocationService_ConfirmListener) :void + { + var listener2 :InvocationMarshaller_ConfirmMarshaller = new InvocationMarshaller_ConfirmMarshaller(); + listener2.listener = arg2; + sendRequest(REMOVE_OBJECTS, [ + arg1, listener2 + ]); + } +} +} diff --git a/src/as/com/threerings/stage/data/StageSceneObject.as b/src/as/com/threerings/stage/data/StageSceneObject.as new file mode 100644 index 00000000..d34328bf --- /dev/null +++ b/src/as/com/threerings/stage/data/StageSceneObject.as @@ -0,0 +1,118 @@ +// +// Vilya library - tools for developing networked games +// Copyright (C) 2002-2010 Three Rings Design, Inc., All Rights Reserved +// http://www.threerings.net/code/vilya/ +// +// This library is free software; you can redistribute it and/or modify it +// under the terms of the GNU Lesser General Public License as published +// by the Free Software Foundation; either version 2.1 of the License, or +// (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// Lesser General Public License for more details. +// +// You should have received a copy of the GNU Lesser General Public +// License along with this library; if not, write to the Free Software +// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +package com.threerings.stage.data { + +import com.threerings.io.ObjectInputStream; +import com.threerings.whirled.spot.data.SpotSceneObject; + +public class StageSceneObject extends SpotSceneObject +{ + // AUTO-GENERATED: FIELDS START + /** The field name of the stageSceneService field. */ + public static const STAGE_SCENE_SERVICE :String = "stageSceneService"; + + /** The field name of the lightLevel field. */ + public static const LIGHT_LEVEL :String = "lightLevel"; + + /** The field name of the lightShade field. */ + public static const LIGHT_SHADE :String = "lightShade"; + // AUTO-GENERATED: FIELDS END + + /** Provides stage scene services. */ + public var stageSceneService :StageSceneMarshaller; + + /** The light level in this scene. 0f being fully on, 1f fully shaded. */ + public var lightLevel :Number = 0; + + /** The color of the light. */ + public var lightShade :int = 0xFFFFFF; + +// // AUTO-GENERATED: METHODS START +// /** +// * Requests that the stageSceneService field be set to the +// * specified value. The local value will be updated immediately and an +// * event will be propagated through the system to notify all listeners +// * that the attribute did change. Proxied copies of this object (on +// * clients) will apply the value change when they received the +// * attribute changed notification. +// */ +// @Generated(value={"com.threerings.presents.tools.GenDObjectTask"}) +// public void setStageSceneService (StageSceneMarshaller value) +// { +// StageSceneMarshaller ovalue = this.stageSceneService; +// requestAttributeChange( +// STAGE_SCENE_SERVICE, value, ovalue); +// this.stageSceneService = value; +// } +// +// /** +// * Requests that the lightLevel field be set to the +// * specified value. The local value will be updated immediately and an +// * event will be propagated through the system to notify all listeners +// * that the attribute did change. Proxied copies of this object (on +// * clients) will apply the value change when they received the +// * attribute changed notification. +// */ +// @Generated(value={"com.threerings.presents.tools.GenDObjectTask"}) +// public void setLightLevel (float value) +// { +// float ovalue = this.lightLevel; +// requestAttributeChange( +// LIGHT_LEVEL, Float.valueOf(value), Float.valueOf(ovalue)); +// this.lightLevel = value; +// } +// +// /** +// * Requests that the lightShade field be set to the +// * specified value. The local value will be updated immediately and an +// * event will be propagated through the system to notify all listeners +// * that the attribute did change. Proxied copies of this object (on +// * clients) will apply the value change when they received the +// * attribute changed notification. +// */ +// @Generated(value={"com.threerings.presents.tools.GenDObjectTask"}) +// public void setLightShade (int value) +// { +// int ovalue = this.lightShade; +// requestAttributeChange( +// LIGHT_SHADE, Integer.valueOf(value), Integer.valueOf(ovalue)); +// this.lightShade = value; +// } +// // AUTO-GENERATED: METHODS END +// +// override public function writeObject (out :ObjectOutputStream) :void +// { +// super.writeObject(out); +// +// out.writeObject(stageSceneService); +// out.writeFloat(lightLevel); +// out.writeInt(lightShade); +// } + + override public function readObject (ins :ObjectInputStream) :void + { + super.readObject(ins); + + stageSceneService = ins.readObject(); + lightLevel = ins.readFloat(); + lightShade = ins.readInt(); + } +} +}