com.threerings.crowd.client
Interface LocationObserver

All Known Implementing Classes:
ChatDirector, LocationAdapter, OccupantDirector

public interface LocationObserver

The location observer interface makes it possible for entities to be notified when the client moves to a new location. It also provides a means for an entity to participate in the ratification process of a new location. Observers may opt to reject a request to change to a new location, probably because something is going on in the previous location that should not be abandoned.

Note that these location callbacks occur on the main thread and should execute quickly and not block under any circumstance.


Method Summary
 void locationChangeFailed(int placeId, String reason)
          This is called on all location observers when a location change request is rejected by the server or fails for some other reason.
 void locationDidChange(PlaceObject place)
          Called when we have switched to a new location.
 boolean locationMayChange(int placeId)
          Called when someone has requested that we switch to a new location.
 

Method Detail

locationMayChange

boolean locationMayChange(int placeId)
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.

Returns:
true if it's OK for the location to change, false if the change request should be aborted.

locationDidChange

void locationDidChange(PlaceObject place)
Called when we have switched to a new location.

Parameters:
place - the place object that represents the new location or null if we have switched to no location.

locationChangeFailed

void locationChangeFailed(int placeId,
                          String reason)
This is called on all location observers when a location change request is rejected by the server or fails for some other reason.

Parameters:
placeId - the place id to which we attempted to relocate, but failed.
reason - the reason code that explains why the location change request was rejected or otherwise failed.