Added the keys() function to the Map interface, replaced instances of

SimpleMap with HashMap. Discarded SimpleMap.


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@4122 542714f4-19e9-0310-aa3c-eee0fc999fb1
This commit is contained in:
Ray Greenwell
2006-05-16 21:06:06 +00:00
parent 4aa8f5a5d5
commit 64e87bb907
12 changed files with 36 additions and 85 deletions
@@ -24,8 +24,9 @@ package com.threerings.crowd.chat.client {
import mx.collections.ArrayCollection;
import com.threerings.util.ArrayUtil;
import com.threerings.util.HashMap;
import com.threerings.util.Map;
import com.threerings.util.ResultListener;
import com.threerings.util.SimpleMap;
import com.threerings.presents.client.BasicDirector;
import com.threerings.presents.client.Client;
@@ -308,7 +309,7 @@ public class ChatDirector extends BasicDirector
args = StringUtil.trim(text.substring(sidx+1));
}
var possibleCommands :SimpleMap = getCommandHandlers(command);
var possibleCommands :Map = getCommandHandlers(command);
switch (possibleCommands.size()) {
case 0:
return MessageBundle.tcompose(
@@ -840,9 +841,9 @@ public class ChatDirector extends BasicDirector
* specified command (i.e. the specified command is a prefix of their
* registered command string).
*/
internal function getCommandHandlers (command :String) :SimpleMap
internal function getCommandHandlers (command :String) :Map
{
var matches :SimpleMap = new SimpleMap();
var matches :Map = new HashMap();
var user :BodyObject =
(_cctx.getClient().getClientObject() as BodyObject);
var keys :Array = _handlers.keys();
@@ -977,7 +978,7 @@ public class ChatDirector extends BasicDirector
/** A mapping from auxiliary chat objects to the types under which
* they are registered. */
protected var _auxes :SimpleMap = new SimpleMap();
protected var _auxes :HashMap = new HashMap();
// /** Validator of who may be added to the chatters list. */
// protected var _chatterValidator :ChatterValidator;
@@ -990,7 +991,7 @@ public class ChatDirector extends BasicDirector
// new ObserverList(ObserverList.FAST_UNSAFE_NOTIFY);
/** Registered chat command handlers. */
protected static const _handlers :SimpleMap = new SimpleMap();
protected static const _handlers :HashMap = new HashMap();
/** A history of chat commands. */
protected static const _history :Array = new Array();
@@ -1,7 +1,7 @@
package com.threerings.crowd.chat.client {
import com.threerings.util.Map;
import com.threerings.util.MessageBundle;
import com.threerings.util.SimpleMap;
import com.threerings.util.StringUtil;
import com.threerings.crowd.chat.data.ChatCodes;
@@ -34,7 +34,7 @@ public class HelpHandler extends CommandHandler
}
// handle "/help help" and "/help boguscmd"
var possibleCmds :SimpleMap = _chatdir.getCommandHandlers(hcmd);
var possibleCmds :Map = _chatdir.getCommandHandlers(hcmd);
if ((hcmd === "help") || (possibleCmds.size() == 0)) {
possibleCmds = _chatdir.getCommandHandlers("");
possibleCmds.remove("help"); // remove help from the list