More faffing about.

- started making chat UI stuff
- upgraded SimpleMap some to use the new Dictionary class
- Lots of experimenting with attaching functions to interface implementations.
I've upgraded to the new beta of Flex and it's giving me the pain. There's
new compiler bugs and I am working blind right now.


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@3966 542714f4-19e9-0310-aa3c-eee0fc999fb1
This commit is contained in:
Ray Greenwell
2006-03-22 02:10:37 +00:00
parent 95ff914ab6
commit 7d3ef496fd
17 changed files with 218 additions and 63 deletions
+2
View File
@@ -1,5 +1,7 @@
package com.threerings.util {
import flash.util.*;
public class ClassUtil
{
public static function getClassName (obj :Object) :String
+16 -14
View File
@@ -1,5 +1,7 @@
package com.threerings.util {
import flash.util.Dictionary;
/**
* I will likely extend this out to be a fully-featured map.
*/
@@ -7,29 +9,28 @@ public class SimpleMap extends Object
{
public function clear () :void
{
_data = new Object();
_data = new Dictionary();
_size = 0;
}
public function get (key :Object) :Object
{
var skey :String = key.toString();
return _data[skey];
return _data[key];
}
public function keys () :Array
{
var arr :Array = new Array();
for (var skey :String in _data) {
arr.push(skey);
for (var key :Object in _data) {
arr.push(key);
}
return arr;
}
public function put (key :Object, value :Object) :Object
{
var skey :String = key.toString();
var oldValue :* = _data[skey];
_data[skey] = value;
var oldValue :* = _data[key];
_data[key] = value;
if (oldValue === undefined) {
_size++;
}
@@ -38,11 +39,12 @@ public class SimpleMap extends Object
public function remove (key :Object) :Object
{
var skey :String = key.toString();
var value :Object = _data[skey];
delete _data[skey];
_size--;
return value;
var value :* = _data[key];
if (value !== undefined) {
delete _data[key];
_size--;
}
return (value as Object);
}
public function size () :int
@@ -50,7 +52,7 @@ public class SimpleMap extends Object
return _size;
}
protected var _data :Object = new Object();
protected var _data :Dictionary = new Dictionary();
protected var _size :int = 0;
}
+2
View File
@@ -1,5 +1,7 @@
package com.threerings.util {
import mx.utils.*;
public class StringUtil
{
public static function isBlank (str :String) :Boolean