Publicize addChatter().

git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@4478 542714f4-19e9-0310-aa3c-eee0fc999fb1
This commit is contained in:
Ray Greenwell
2006-12-09 00:41:00 +00:00
parent a9e60be7c7
commit 13e5d3093d
@@ -186,6 +186,33 @@ public class ChatDirector extends BasicDirector
return _chatters;
}
/**
* Adds a chatter to our list of recent chatters. This is normally done
* automatically by the ChatDirector, but may be called to also to
* forcibly add a chatter. The ChatterValidator will have to approve
* of the chatter.
*/
public function addChatter (name :Name) :void
{
// check to see if the chatter validator approves..
if ((_chatterValidator != null) &&
(!_chatterValidator.isChatterValid(name))) {
return;
}
var wasThere :Boolean = ArrayUtil.removeAll(_chatters, name);
_chatters.unshift(name);
if (!wasThere) {
if (_chatters.length > MAX_CHATTERS) {
_chatters.length = MAX_CHATTERS; // truncate array
}
// we only notify on a change to the contents, not just reordering
notifyChatterObservers();
}
}
/**
* Registers a chat command handler.
*
@@ -896,30 +923,6 @@ public class ChatDirector extends BasicDirector
return _history;
}
/**
* Adds a chatter to our list of recent chatters.
*/
protected function addChatter (name :Name) :void
{
// check to see if the chatter validator approves..
if ((_chatterValidator != null) &&
(!_chatterValidator.isChatterValid(name))) {
return;
}
var wasThere :Boolean = ArrayUtil.removeAll(_chatters, name);
_chatters.unshift(name);
if (!wasThere) {
if (_chatters.length > MAX_CHATTERS) {
_chatters.length = MAX_CHATTERS; // truncate array
}
// we only notify on a change to the contents, not just reordering
notifyChatterObservers();
}
}
/**
* Notifies all registered {@link ChatterObserver}s that the list of
* chatters has changed.