diff --git a/src/as/com/threerings/ezgame/data/EZGameConfig.as b/src/as/com/threerings/ezgame/data/EZGameConfig.as index 37238251..08afca3b 100644 --- a/src/as/com/threerings/ezgame/data/EZGameConfig.as +++ b/src/as/com/threerings/ezgame/data/EZGameConfig.as @@ -20,19 +20,20 @@ import com.threerings.ezgame.client.EZGameController; /** * A game config for a simple multiplayer ez game. */ -public /* abstract */ class EZGameConfig extends GameConfig - implements PartyGameConfig +public class EZGameConfig extends GameConfig + implements PartyGameConfig, Hashable { // TODO: this will eventually contain various XML configuration bits, // or we'll expand this to contain other information. // For now, the configData is either a classname or url. public var configData :String; - override public function createController () :PlaceController + public function EZGameConfig () { - return new EZGameController(); + // nothing needed } + // from abstract GameConfig override public function getBundleName () :String { return "general"; @@ -41,11 +42,24 @@ public /* abstract */ class EZGameConfig extends GameConfig // TODO //override public function createConfigurator () :GameConfigurator + override public function getGameName () :String { return MessageBundle.taint(configData); } + // from PlaceConfig + override public function createController () :PlaceController + { + return new EZGameController(); + } + + // from abstract PlaceConfig + public function getManagerClassName () :String + { + throw new Error("Not implemented."); + } + // from PartyGameConfig public function getPartyGameType () :int { @@ -53,6 +67,11 @@ public /* abstract */ class EZGameConfig extends GameConfig return PartyGameCodes.NOT_PARTY_GAME; } + override public function hashCode () :int + { + return super.hashCode(); // TODO: incorporate configData? + } + override public function equals (other :Object) :Boolean { if (!super.equals(other)) { @@ -63,23 +82,20 @@ public /* abstract */ class EZGameConfig extends GameConfig return (this.configData === that.configData); } - override public function hashCode () :int - { - return super.hashCode(); // TODO: incorporate configData? - } - - override public function writeObject (out :ObjectOutputStream) :void - { - super.writeObject(out); - - out.writeField(configData); - } - + // from interface Streamable override public function readObject (ins :ObjectInputStream) :void { super.readObject(ins); configData = (ins.readField(String) as String); } + + // from interface Streamable + override public function writeObject (out :ObjectOutputStream) :void + { + super.writeObject(out); + + out.writeField(configData); + } } } diff --git a/src/as/com/threerings/ezgame/data/PropertySetEvent.as b/src/as/com/threerings/ezgame/data/PropertySetEvent.as index f72c9fde..178918aa 100644 --- a/src/as/com/threerings/ezgame/data/PropertySetEvent.as +++ b/src/as/com/threerings/ezgame/data/PropertySetEvent.as @@ -29,6 +29,14 @@ public class PropertySetEvent extends NamedEvent super(0, null); } + // from abstract DEvent + override public function applyToObject (target :DObject) :Boolean + { + _oldValue = + EZGameObject(target).applyPropertySet(_name, _data, _index); + return true; + } + /** * Get the value that was set for the property. */ @@ -37,14 +45,6 @@ public class PropertySetEvent extends NamedEvent return _data; } - /** - * Get the old value. - */ - public function getOldValue () :Object - { - return _oldValue; - } - /** * Get the index, or -1 if not applicable. */ @@ -53,11 +53,28 @@ public class PropertySetEvent extends NamedEvent return _index; } - override public function applyToObject (target :DObject) :Boolean + /** + * Get the old value. + */ + public function getOldValue () :Object { - _oldValue = - EZGameObject(target).applyPropertySet(_name, _data, _index); - return true; + return _oldValue; + } + + // from interface Streamable + override public function readObject (ins :ObjectInputStream) :void + { + super.readObject(ins); + _index = ins.readInt(); + _data = EZObjectMarshaller.decode(ins.readObject()); + } + + // from interface Streamable + override public function writeObject (out :ObjectOutputStream) :void + { + super.writeObject(out); + out.writeInt(_index); + out.writeObject(_data); } override protected function notifyListener (listener :Object) :void @@ -67,14 +84,6 @@ public class PropertySetEvent extends NamedEvent } } - override public function readObject (ins :ObjectInputStream) :void - { - super.readObject(ins); - - _index = ins.readInt(); - _data = EZObjectMarshaller.decode(ins.readObject()); - } - /** The index of the property, if applicable. */ protected var _index :int; diff --git a/src/java/com/threerings/ezgame/data/PropertySetEvent.java b/src/java/com/threerings/ezgame/data/PropertySetEvent.java index e00a53fe..7170a6eb 100644 --- a/src/java/com/threerings/ezgame/data/PropertySetEvent.java +++ b/src/java/com/threerings/ezgame/data/PropertySetEvent.java @@ -80,7 +80,7 @@ public class PropertySetEvent extends NamedEvent } } - /** The index. */ + /** The index of the property, if applicable. */ protected int _index; /** The client-side data that is assigned to this property. */