Updated to not have to return a boolean from ObserverList functions.

git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@4485 542714f4-19e9-0310-aa3c-eee0fc999fb1
This commit is contained in:
Ray Greenwell
2006-12-14 02:14:01 +00:00
parent 8b73d881f3
commit 822b82baf0
2 changed files with 13 additions and 14 deletions
@@ -414,7 +414,7 @@ public class LocationDirector extends BasicDirector
didLeavePlace();
// let our observers know that we're no longer in a location
_observers.apply(_didChangeOp);
_observers.apply(didChangeOp);
// clear out everything else (it's possible that we were logged
// off in the middle of a change location request)
@@ -471,7 +471,7 @@ public class LocationDirector extends BasicDirector
}
// let our observers know that all is well on the western front
_observers.apply(_didChangeOp);
_observers.apply(didChangeOp);
}
// documentation inherited from interface Subscriber
@@ -533,6 +533,14 @@ public class LocationDirector extends BasicDirector
}
}
/**
* The operation used to inform observers that the location changed.
*/
protected function didChangeOp (obs :Object) :void
{
(obs as LocationObserver).locationDidChange(_plobj);
};
protected function notifyFailure (placeId :int, reason :String) :void
{
_observers.apply(function (obs :Object) :void {
@@ -579,12 +587,6 @@ public class LocationDirector extends BasicDirector
* how we failed to move. */
protected var _moveListener :ResultListener;
/** The operation used to inform observers that the location changed. */
protected var _didChangeOp :Function = function (obs :Object) :void
{
(obs as LocationObserver).locationDidChange(_plobj);
};
/** We require that a moveTo request be outstanding for one minute
* before it is declared to be stale. */
protected static const STALE_REQUEST_DURATION :int = 60 * 1000;
@@ -159,9 +159,8 @@ public class OccupantDirector extends BasicDirector
// now let the occupant observers know what's up
var info :OccupantInfo = (event.getEntry() as OccupantInfo);
_observers.apply(function (obj :Object) :Boolean {
_observers.apply(function (obj :Object) :void {
(obj as OccupantObserver).occupantEntered(info);
return true;
});
}
@@ -176,9 +175,8 @@ public class OccupantDirector extends BasicDirector
// now let the occupant observers know what's up
var info :OccupantInfo = (event.getEntry() as OccupantInfo);
var oinfo :OccupantInfo = (event.getOldEntry() as OccupantInfo);
_observers.apply(function (obj :Object) :Boolean {
_observers.apply(function (obj :Object) :void {
(obj as OccupantObserver).occupantUpdated(oinfo, info);
return true;
});
}
@@ -192,9 +190,8 @@ public class OccupantDirector extends BasicDirector
// let the occupant observers know what's up
var oinfo :OccupantInfo = (event.getOldEntry() as OccupantInfo);
_observers.apply(function (obj :Object) :Boolean {
_observers.apply(function (obj :Object) :void {
(obj as OccupantObserver).occupantLeft(oinfo);
return true;
});
}