More crap, some new discoveries, backtracking, annoyance.

git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@3918 542714f4-19e9-0310-aa3c-eee0fc999fb1
This commit is contained in:
Ray Greenwell
2006-03-07 03:49:33 +00:00
parent e5c65b95b5
commit d8276bb4a9
12 changed files with 138 additions and 101 deletions
+1
View File
@@ -26,6 +26,7 @@ public class ClassUtil
public static function getClassByName (cname :String) :Class
{
// see also ApplicationDomain.currentDomain.getClass(cname)
return flash.util.getClassByName(cname);
}
+33 -4
View File
@@ -4,15 +4,44 @@ package com.threerings.util {
* Marker class that allows us to use ActionScript's built-in hashing
* function without hassle.
*/
public dynamic class SimpleMap extends Object
public class SimpleMap extends Object
{
public function clear () :void
{
_data = new Object();
}
public function get (key :Object) :Object
{
var skey :String = key.toString();
return _data[skey];
}
public function keys () :Array
{
var arr :Array = new Array();
for (var skey :String in _data) {
arr.push(skey);
}
return arr;
}
public function put (key :Object, value :Object) :Object
{
var skey :String = key.toString();
var oldValue :Object = _data[skey];
_data[skey] = value;
return oldValue;
}
public function remove (key :Object) :Object
{
// I'm not sure this really works
var skey :String = key.toString();
var value :Object = this[skey];
this[skey] = undefined;
var value :Object = _data[skey];
delete _data[skey];
return value;
}
private var _data :Object = new Object();
}
}
+1 -2
View File
@@ -1,7 +1,5 @@
package com.threerings.util {
import flash.util.describeType;
import mx.utils.ObjectUtil;
import com.threerings.io.ArrayMask;
@@ -83,6 +81,7 @@ public dynamic class TypedArray extends Array
* except gives it a clue as to how to stream to our server. */
protected var _type :Class;
/** Whether or not the type of the array represents a final class. */
protected var _final :Boolean;
protected var _delegate :Streamer;