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:
@@ -414,7 +414,7 @@ public class LocationDirector extends BasicDirector
|
|||||||
didLeavePlace();
|
didLeavePlace();
|
||||||
|
|
||||||
// let our observers know that we're no longer in a location
|
// 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
|
// clear out everything else (it's possible that we were logged
|
||||||
// off in the middle of a change location request)
|
// 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
|
// let our observers know that all is well on the western front
|
||||||
_observers.apply(_didChangeOp);
|
_observers.apply(didChangeOp);
|
||||||
}
|
}
|
||||||
|
|
||||||
// documentation inherited from interface Subscriber
|
// 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
|
protected function notifyFailure (placeId :int, reason :String) :void
|
||||||
{
|
{
|
||||||
_observers.apply(function (obs :Object) :void {
|
_observers.apply(function (obs :Object) :void {
|
||||||
@@ -579,12 +587,6 @@ public class LocationDirector extends BasicDirector
|
|||||||
* how we failed to move. */
|
* how we failed to move. */
|
||||||
protected var _moveListener :ResultListener;
|
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
|
/** We require that a moveTo request be outstanding for one minute
|
||||||
* before it is declared to be stale. */
|
* before it is declared to be stale. */
|
||||||
protected static const STALE_REQUEST_DURATION :int = 60 * 1000;
|
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
|
// now let the occupant observers know what's up
|
||||||
var info :OccupantInfo = (event.getEntry() as OccupantInfo);
|
var info :OccupantInfo = (event.getEntry() as OccupantInfo);
|
||||||
_observers.apply(function (obj :Object) :Boolean {
|
_observers.apply(function (obj :Object) :void {
|
||||||
(obj as OccupantObserver).occupantEntered(info);
|
(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
|
// now let the occupant observers know what's up
|
||||||
var info :OccupantInfo = (event.getEntry() as OccupantInfo);
|
var info :OccupantInfo = (event.getEntry() as OccupantInfo);
|
||||||
var oinfo :OccupantInfo = (event.getOldEntry() 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);
|
(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
|
// let the occupant observers know what's up
|
||||||
var oinfo :OccupantInfo = (event.getOldEntry() as OccupantInfo);
|
var oinfo :OccupantInfo = (event.getOldEntry() as OccupantInfo);
|
||||||
_observers.apply(function (obj :Object) :Boolean {
|
_observers.apply(function (obj :Object) :void {
|
||||||
(obj as OccupantObserver).occupantLeft(oinfo);
|
(obj as OccupantObserver).occupantLeft(oinfo);
|
||||||
return true;
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user