Match recent changes on Java side.

git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@4432 542714f4-19e9-0310-aa3c-eee0fc999fb1
This commit is contained in:
Ray Greenwell
2006-10-23 17:47:43 +00:00
parent a98a15a6d4
commit 8683642e4f
4 changed files with 41 additions and 18 deletions
+12 -2
View File
@@ -25,14 +25,24 @@ public class ObserverList
/**
* Add an observer to this list.
*
* @param index the index at which to add the observer, or -1 for the end.
*/
public function add (observer :Object) :void
public function add (observer :Object, index :int = -1) :void
{
if (!ArrayUtil.contains(_list, observer)) {
_list.push(observer);
_list.splice(index, 0, observer); // -1 to splice means "end"
}
}
/**
* Return the size of the list.
*/
public function size () :int
{
return _list.length;
}
/**
* Remove an observer from this list.
*/