Moved the serverless game stuff out of msoy and back into the vilya library.
We'll be using this in game gardens, at least. Note that the actionscript side currently doesn't compile because of limitations in building a .swc file, but that'll be fixed soon. git-svn-id: svn+ssh://src.earth.threerings.net/vilya/trunk@47 c613c5cb-e716-0410-b11b-feb51c14d237
This commit is contained in:
@@ -0,0 +1,76 @@
|
||||
package com.threerings.ezgame {
|
||||
|
||||
import flash.events.Event;
|
||||
|
||||
/**
|
||||
* Property change events are dispatched after the property change was
|
||||
* validated on the server.
|
||||
*/
|
||||
public class PropertyChangedEvent extends Event
|
||||
{
|
||||
/** The type of a property change event. */
|
||||
public static const TYPE :String = "PropChanged";
|
||||
|
||||
/**
|
||||
* Get the name of the property that changed.
|
||||
*/
|
||||
public function get name () :String
|
||||
{
|
||||
return _name;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the property's new value.
|
||||
*/
|
||||
public function get newValue () :Object
|
||||
{
|
||||
return _newValue;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the property's previous value (handy!).
|
||||
*/
|
||||
public function get oldValue () :Object
|
||||
{
|
||||
return _oldValue;
|
||||
}
|
||||
|
||||
/**
|
||||
* If an array element was updated, get the index, or -1 if not applicable.
|
||||
*/
|
||||
public function get index () :int
|
||||
{
|
||||
return _index;
|
||||
}
|
||||
|
||||
/**
|
||||
* Constructor.
|
||||
*/
|
||||
public function PropertyChangedEvent (
|
||||
propName :String, newValue :Object, oldValue :Object, index :int = -1)
|
||||
{
|
||||
super(TYPE);
|
||||
_name = propName;
|
||||
_newValue = newValue;
|
||||
_oldValue = oldValue;
|
||||
_index = index;
|
||||
}
|
||||
|
||||
override public function toString () :String
|
||||
{
|
||||
return "[PropertyChangedEvent name=" + _name + ", value=" + _newValue +
|
||||
((index < 0) ? "" : (", index=" + index)) + "]";
|
||||
}
|
||||
|
||||
override public function clone () :Event
|
||||
{
|
||||
return new PropertyChangedEvent(_name, _newValue, _oldValue, _index);
|
||||
}
|
||||
|
||||
/** Our implementation details. */
|
||||
protected var _name :String;
|
||||
protected var _newValue :Object;
|
||||
protected var _oldValue :Object;
|
||||
protected var _index :int;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user