Made ObserverList work with a passed-in function, actionscript style.
I might reconsider some earlier decisions to go away from ObserverList.


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@3952 542714f4-19e9-0310-aa3c-eee0fc999fb1
This commit is contained in:
Ray Greenwell
2006-03-16 02:11:27 +00:00
parent 3325b1d7a3
commit 03d94291db
11 changed files with 1141 additions and 0 deletions
+13
View File
@@ -5,6 +5,19 @@ package com.threerings.util {
*/
public class ArrayUtil
{
/**
* Return the first index of the specified element, or -1 if not present.
*/
public static function indexOf (arr :Array, element :Object) :int
{
for (var ii :int = 0; ii < arr.length; ii++) {
if (arr[ii] === element) {
return ii;
}
}
return -1;
}
/**
* Remove the first instance of the specified element from the array.
*/