|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectcom.threerings.presents.client.BasicDirector
com.threerings.whirled.zone.client.ZoneDirector
public class ZoneDirector
The zone director augments the scene services with the notion of zones. Zones are self-contained, connected groups of scenes. The normal scene director services can be used to move from scene to scene, but moving to a new zone requires a special move request which can be accomplished via the zone director. The zone director also makes available the zone summary which provides information on the zone which can be used to generate an overview map or similar.
| Nested Class Summary |
|---|
| Nested classes/interfaces inherited from interface com.threerings.presents.client.InvocationReceiver |
|---|
InvocationReceiver.Registration |
| Field Summary | |
|---|---|
protected WhirledContext |
_ctx
A reference to the active client context. |
protected ArrayList<ZoneObserver> |
_observers
Our zone observer list. |
protected int |
_previousZoneId
Our previous zone id. |
protected SceneDirector |
_scdir
A reference to the scene director with which we coordinate. |
protected ZoneSummary |
_summary
A reference to the zone summary for the currently occupied zone. |
protected ZoneService |
_zservice
Provides access to zone services. |
| Fields inherited from class com.threerings.presents.client.BasicDirector |
|---|
_availableInStandalone |
| Constructor Summary | |
|---|---|
ZoneDirector(WhirledContext ctx,
SceneDirector scdir)
Constructs a zone director with the supplied context, and delegate scene director (which the zone director will coordinate with when moving from scene to scene). |
|
| Method Summary | |
|---|---|
void |
addZoneObserver(ZoneObserver observer)
Adds a zone observer to the list. |
void |
clientDidLogoff(Client client)
|
protected void |
fetchServices(Client client)
|
void |
forcedMove(int zoneId,
int sceneId)
Used to communicate a required move notification to the client. |
ZoneSummary |
getZoneSummary()
Returns the summary for the zone currently occupied by the client or null if the client does not currently occupy a zone (not a normal situation). |
void |
moveSucceeded(int placeId,
PlaceConfig config,
ZoneSummary summary)
Called in response to a successful ZoneService.moveTo(com.threerings.presents.client.Client, int, int, int, com.threerings.whirled.zone.client.ZoneService.ZoneMoveListener) request. |
void |
moveSucceededWithScene(int placeId,
PlaceConfig config,
ZoneSummary summary,
SceneModel model)
Called in response to a successful ZoneService.moveTo(com.threerings.presents.client.Client, int, int, int, com.threerings.whirled.zone.client.ZoneService.ZoneMoveListener) request when our cached
scene was out of date and the server determined that we needed an updated copy. |
void |
moveSucceededWithUpdates(int placeId,
PlaceConfig config,
ZoneSummary summary,
SceneUpdate[] updates)
Called in response to a successful ZoneService.moveTo(com.threerings.presents.client.Client, int, int, int, com.threerings.whirled.zone.client.ZoneService.ZoneMoveListener) request when our cached
scene was out of date and the server determined that we needed some updates. |
boolean |
moveTo(int zoneId,
int sceneId)
Requests that this client move the specified scene in the specified zone. |
boolean |
moveTo(int zoneId,
int sceneId,
com.samskivert.util.ResultListener<PlaceConfig> rl)
Requests that this client move the specified scene in the specified zone. |
protected void |
notifyObservers(Object data)
Notifies observers of success or failure, depending on the type of object provided as data. |
void |
recoverMoveTo(int previousSceneId)
Should instruct the client to move the last known working location (as well as clean up after the failed moveTo request). |
void |
removeZoneObserver(ZoneObserver observer)
Removes a zone observer from the list. |
void |
requestFailed(String reason)
|
| Methods inherited from class com.threerings.presents.client.BasicDirector |
|---|
assertAvailable, clientDidLogon, clientObjectDidChange, clientObjectUpdated, clientWillLogon, isAvailable, isAvailableInStandalone, registerServices, setAvailableInStandalone |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected WhirledContext _ctx
protected SceneDirector _scdir
protected ZoneService _zservice
protected ZoneSummary _summary
protected ArrayList<ZoneObserver> _observers
protected int _previousZoneId
| Constructor Detail |
|---|
public ZoneDirector(WhirledContext ctx,
SceneDirector scdir)
| Method Detail |
|---|
public ZoneSummary getZoneSummary()
public void addZoneObserver(ZoneObserver observer)
public void removeZoneObserver(ZoneObserver observer)
public boolean moveTo(int zoneId,
int sceneId)
public boolean moveTo(int zoneId,
int sceneId,
com.samskivert.util.ResultListener<PlaceConfig> rl)
protected void fetchServices(Client client)
fetchServices in class BasicDirectorpublic void clientDidLogoff(Client client)
clientDidLogoff in interface SessionObserverclientDidLogoff in class BasicDirector
public void moveSucceeded(int placeId,
PlaceConfig config,
ZoneSummary summary)
ZoneService.ZoneMoveListenerZoneService.moveTo(com.threerings.presents.client.Client, int, int, int, com.threerings.whirled.zone.client.ZoneService.ZoneMoveListener) request.
moveSucceeded in interface ZoneService.ZoneMoveListener
public void moveSucceededWithUpdates(int placeId,
PlaceConfig config,
ZoneSummary summary,
SceneUpdate[] updates)
ZoneService.ZoneMoveListenerZoneService.moveTo(com.threerings.presents.client.Client, int, int, int, com.threerings.whirled.zone.client.ZoneService.ZoneMoveListener) request when our cached
scene was out of date and the server determined that we needed some updates.
moveSucceededWithUpdates in interface ZoneService.ZoneMoveListener
public void moveSucceededWithScene(int placeId,
PlaceConfig config,
ZoneSummary summary,
SceneModel model)
ZoneService.ZoneMoveListenerZoneService.moveTo(com.threerings.presents.client.Client, int, int, int, com.threerings.whirled.zone.client.ZoneService.ZoneMoveListener) request when our cached
scene was out of date and the server determined that we needed an updated copy.
moveSucceededWithScene in interface ZoneService.ZoneMoveListenerpublic void requestFailed(String reason)
requestFailed in interface InvocationService.InvocationListener
public void forcedMove(int zoneId,
int sceneId)
ZoneReceiverZoneService.moveTo(com.threerings.presents.client.Client, int, int, int, com.threerings.whirled.zone.client.ZoneService.ZoneMoveListener) request to move to the new scene in the specified
zone.
forcedMove in interface ZoneReceiverpublic void recoverMoveTo(int previousSceneId)
SceneDirector.MoveHandler
recoverMoveTo in interface SceneDirector.MoveHandlerprotected void notifyObservers(Object data)
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||