From 822b82baf017a4f0059cdbdcefc4feb9daa15560 Mon Sep 17 00:00:00 2001 From: Ray Greenwell Date: Thu, 14 Dec 2006 02:14:01 +0000 Subject: [PATCH] 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 --- .../crowd/client/LocationDirector.as | 18 ++++++++++-------- .../crowd/client/OccupantDirector.as | 9 +++------ 2 files changed, 13 insertions(+), 14 deletions(-) diff --git a/src/as/com/threerings/crowd/client/LocationDirector.as b/src/as/com/threerings/crowd/client/LocationDirector.as index d0c08d082..8a30cbf0b 100644 --- a/src/as/com/threerings/crowd/client/LocationDirector.as +++ b/src/as/com/threerings/crowd/client/LocationDirector.as @@ -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; diff --git a/src/as/com/threerings/crowd/client/OccupantDirector.as b/src/as/com/threerings/crowd/client/OccupantDirector.as index a05232531..dcd793c47 100644 --- a/src/as/com/threerings/crowd/client/OccupantDirector.as +++ b/src/as/com/threerings/crowd/client/OccupantDirector.as @@ -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; }); }