Updated using the code generator.

git-svn-id: svn+ssh://src.earth.threerings.net/vilya/trunk@96 c613c5cb-e716-0410-b11b-feb51c14d237
This commit is contained in:
Michael Bayne
2006-10-05 00:47:20 +00:00
parent a8fa272219
commit 451218a1a4
3 changed files with 62 additions and 37 deletions
@@ -20,19 +20,20 @@ import com.threerings.ezgame.client.EZGameController;
/** /**
* A game config for a simple multiplayer ez game. * A game config for a simple multiplayer ez game.
*/ */
public /* abstract */ class EZGameConfig extends GameConfig public class EZGameConfig extends GameConfig
implements PartyGameConfig implements PartyGameConfig, Hashable
{ {
// TODO: this will eventually contain various XML configuration bits, // TODO: this will eventually contain various XML configuration bits,
// or we'll expand this to contain other information. // or we'll expand this to contain other information.
// For now, the configData is either a classname or url. // For now, the configData is either a classname or url.
public var configData :String; 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 override public function getBundleName () :String
{ {
return "general"; return "general";
@@ -41,11 +42,24 @@ public /* abstract */ class EZGameConfig extends GameConfig
// TODO // TODO
//override public function createConfigurator () :GameConfigurator //override public function createConfigurator () :GameConfigurator
override public function getGameName () :String override public function getGameName () :String
{ {
return MessageBundle.taint(configData); 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 // from PartyGameConfig
public function getPartyGameType () :int public function getPartyGameType () :int
{ {
@@ -53,6 +67,11 @@ public /* abstract */ class EZGameConfig extends GameConfig
return PartyGameCodes.NOT_PARTY_GAME; return PartyGameCodes.NOT_PARTY_GAME;
} }
override public function hashCode () :int
{
return super.hashCode(); // TODO: incorporate configData?
}
override public function equals (other :Object) :Boolean override public function equals (other :Object) :Boolean
{ {
if (!super.equals(other)) { if (!super.equals(other)) {
@@ -63,23 +82,20 @@ public /* abstract */ class EZGameConfig extends GameConfig
return (this.configData === that.configData); return (this.configData === that.configData);
} }
override public function hashCode () :int // from interface Streamable
{
return super.hashCode(); // TODO: incorporate configData?
}
override public function writeObject (out :ObjectOutputStream) :void
{
super.writeObject(out);
out.writeField(configData);
}
override public function readObject (ins :ObjectInputStream) :void override public function readObject (ins :ObjectInputStream) :void
{ {
super.readObject(ins); super.readObject(ins);
configData = (ins.readField(String) as String); configData = (ins.readField(String) as String);
} }
// from interface Streamable
override public function writeObject (out :ObjectOutputStream) :void
{
super.writeObject(out);
out.writeField(configData);
}
} }
} }
@@ -29,6 +29,14 @@ public class PropertySetEvent extends NamedEvent
super(0, null); 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. * Get the value that was set for the property.
*/ */
@@ -37,14 +45,6 @@ public class PropertySetEvent extends NamedEvent
return _data; return _data;
} }
/**
* Get the old value.
*/
public function getOldValue () :Object
{
return _oldValue;
}
/** /**
* Get the index, or -1 if not applicable. * Get the index, or -1 if not applicable.
*/ */
@@ -53,11 +53,28 @@ public class PropertySetEvent extends NamedEvent
return _index; return _index;
} }
override public function applyToObject (target :DObject) :Boolean /**
* Get the old value.
*/
public function getOldValue () :Object
{ {
_oldValue = return _oldValue;
EZGameObject(target).applyPropertySet(_name, _data, _index); }
return true;
// 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 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. */ /** The index of the property, if applicable. */
protected var _index :int; protected var _index :int;
@@ -80,7 +80,7 @@ public class PropertySetEvent extends NamedEvent
} }
} }
/** The index. */ /** The index of the property, if applicable. */
protected int _index; protected int _index;
/** The client-side data that is assigned to this property. */ /** The client-side data that is assigned to this property. */