From e08138875f22d321a05982b9a37e23fa10b81cb2 Mon Sep 17 00:00:00 2001 From: Michael Bayne Date: Thu, 2 Aug 2001 04:59:54 +0000 Subject: [PATCH] More location observer stuff. git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@144 542714f4-19e9-0310-aa3c-eee0fc999fb1 --- .../crowd/client/LocationDirector.java | 20 ++++++++++++++++++- .../crowd/client/LocationObserver.java | 5 ++++- 2 files changed, 23 insertions(+), 2 deletions(-) diff --git a/src/java/com/threerings/crowd/client/LocationDirector.java b/src/java/com/threerings/crowd/client/LocationDirector.java index 91076f83e..2120a13bf 100644 --- a/src/java/com/threerings/crowd/client/LocationDirector.java +++ b/src/java/com/threerings/crowd/client/LocationDirector.java @@ -1,5 +1,5 @@ // -// $Id: LocationDirector.java,v 1.4 2001/07/23 22:59:43 mdb Exp $ +// $Id: LocationDirector.java,v 1.5 2001/08/02 04:59:54 mdb Exp $ package com.threerings.cocktail.party.client; @@ -33,6 +33,24 @@ public class LocationManager ctx.getClient().addObserver(this); } + /** + * Adds a location observer to the list. This observer will + * subsequently be notified of potential, effected and failed location + * changes. + */ + public void addLocationObserver (LocationObserver observer) + { + _observers.add(observer); + } + + /** + * Removes a location observer from the list. + */ + public void removeLocationObserver (LocationObserver observer) + { + _observers.remove(observer); + } + /** * Requests that this client be moved to the specified place. A * request will be made and when the response is received, the diff --git a/src/java/com/threerings/crowd/client/LocationObserver.java b/src/java/com/threerings/crowd/client/LocationObserver.java index 435f7cb64..eb3e68a6f 100644 --- a/src/java/com/threerings/crowd/client/LocationObserver.java +++ b/src/java/com/threerings/crowd/client/LocationObserver.java @@ -1,5 +1,5 @@ // -// $Id: LocationObserver.java,v 1.2 2001/07/23 22:59:43 mdb Exp $ +// $Id: LocationObserver.java,v 1.3 2001/08/02 04:59:54 mdb Exp $ package com.threerings.cocktail.party.client; @@ -22,6 +22,9 @@ public interface LocationObserver * Called when someone has requested that we switch to a new location. * An observer may choose to veto the location change request for some * reason or other. + * + * @return true if it's OK for the location to change, false if the + * change request should be aborted. */ public boolean locationMayChange (int placeId);