Created SceneCodes, moved scene invocation service codes into there.

Changed SceneManager to SceneDirector. Updated to deal with
LocationManager name change. Clean, clean, clean.


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@369 542714f4-19e9-0310-aa3c-eee0fc999fb1
This commit is contained in:
Michael Bayne
2001-10-01 22:16:02 +00:00
parent 027bb29769
commit 64bed2eb12
6 changed files with 54 additions and 39 deletions
@@ -0,0 +1,15 @@
//
// $Id: SceneCodes.java,v 1.1 2001/10/01 22:16:02 mdb Exp $
package com.threerings.whirled.client;
import com.threerings.cocktail.party.client.LocationCodes;
/**
* Contains codes used by the scene invocation services.
*/
public interface SceneCodes extends LocationCodes
{
/** The module name for the scene services. */
public static final String MODULE_NAME = "whirled!scene";
}
@@ -1,5 +1,5 @@
//
// $Id: SceneDirector.java,v 1.2 2001/08/15 02:13:12 mdb Exp $
// $Id: SceneDirector.java,v 1.3 2001/10/01 22:16:02 mdb Exp $
package com.threerings.whirled.client;
@@ -9,7 +9,7 @@ import com.threerings.cocktail.cher.dobj.DObject;
import com.threerings.cocktail.cher.dobj.ObjectAccessException;
import com.threerings.cocktail.cher.util.IntMap;
import com.threerings.cocktail.party.client.LocationManager;
import com.threerings.cocktail.party.client.LocationDirector;
import com.threerings.cocktail.party.client.LocationObserver;
import com.threerings.cocktail.party.data.PlaceObject;
@@ -20,24 +20,25 @@ import com.threerings.whirled.data.Scene;
import com.threerings.whirled.util.WhirledContext;
/**
* The scene manager is the client's interface to all things scene
* The scene director is the client's interface to all things scene
* related. It interfaces with the scene repository to ensure that scene
* objects are available when the client enters a particular scene. It
* handles moving from scene to scene (it extends and replaces the
* location manager in order to do this).
* location director in order to do this).
*
* <p> Note that when the scene manager is in use instead of the location
* manager, scene ids instead of place oids will be supplied to {@link
* <p> Note that when the scene director is in use instead of the location
* director, scene ids instead of place oids will be supplied to {@link
* com.threerings.cocktail.party.client.LocationObserver#locationMayChange}
* and {@link
* com.threerings.cocktail.party.client.LocationObserver#locationChangeFailed}.
*/
public class SceneManager extends LocationManager
public class SceneDirector
extends LocationDirector implements SceneCodes
{
/**
* Creates a new scene manager with the specified context.
* Creates a new scene director with the specified context.
*/
public SceneManager (WhirledContext ctx, SceneRepository screp)
public SceneDirector (WhirledContext ctx, SceneRepository screp)
{
super(ctx);
@@ -1,5 +1,5 @@
//
// $Id: SceneService.java,v 1.2 2001/08/14 06:51:07 mdb Exp $
// $Id: SceneService.java,v 1.3 2001/10/01 22:16:02 mdb Exp $
package com.threerings.whirled.client;
@@ -12,11 +12,8 @@ import com.threerings.whirled.Log;
* The scene service class provides the client interface to the scene
* related invocation services (e.g. moving from scene to scene).
*/
public class SceneService
public class SceneService implements SceneCodes
{
/** The module name for the scene services. */
public static final String MODULE = "whirled!scene";
/**
* Requests that that this client's body be moved to the specified
* scene.
@@ -26,12 +23,12 @@ public class SceneService
* have in our local repository.
*/
public static void moveTo (Client client, int sceneId,
int sceneVers, SceneManager rsptarget)
int sceneVers, SceneDirector rsptarget)
{
InvocationManager invmgr = client.getInvocationManager();
Object[] args = new Object[] {
new Integer(sceneId), new Integer(sceneVers) };
invmgr.invoke(MODULE, "MoveTo", args, rsptarget);
invmgr.invoke(MODULE_NAME, MOVE_TO_REQUEST, args, rsptarget);
Log.info("Sent moveTo request [scene=" + sceneId +
", version=" + sceneVers + "].");
}