More location observer stuff.

git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@144 542714f4-19e9-0310-aa3c-eee0fc999fb1
This commit is contained in:
Michael Bayne
2001-08-02 04:59:54 +00:00
parent 9d93650b65
commit e08138875f
2 changed files with 23 additions and 2 deletions
@@ -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; package com.threerings.cocktail.party.client;
@@ -33,6 +33,24 @@ public class LocationManager
ctx.getClient().addObserver(this); 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 * Requests that this client be moved to the specified place. A
* request will be made and when the response is received, the * request will be made and when the response is received, the
@@ -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; 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. * Called when someone has requested that we switch to a new location.
* An observer may choose to veto the location change request for some * An observer may choose to veto the location change request for some
* reason or other. * 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); public boolean locationMayChange (int placeId);