Moved the scene name into the basic scene model from the editable scene

model as we'll be having scene names in the runtime system.


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@757 542714f4-19e9-0310-aa3c-eee0fc999fb1
This commit is contained in:
Michael Bayne
2001-12-12 19:06:15 +00:00
parent d31ebd2b54
commit 4a7792f4d6
6 changed files with 41 additions and 33 deletions
@@ -1,5 +1,5 @@
//
// $Id: DisplayScene.java,v 1.1 2001/11/12 20:56:55 mdb Exp $
// $Id: DisplayScene.java,v 1.2 2001/12/12 19:06:15 mdb Exp $
package com.threerings.whirled.client;
@@ -26,6 +26,11 @@ public interface DisplayScene
*/
public int getId ();
/**
* Returns the name of this scene.
*/
public String getName ();
/**
* Returns the version number of this scene.
*/
@@ -1,5 +1,5 @@
//
// $Id: DisplaySceneImpl.java,v 1.1 2001/11/12 20:56:55 mdb Exp $
// $Id: DisplaySceneImpl.java,v 1.2 2001/12/12 19:06:15 mdb Exp $
package com.threerings.whirled.client;
@@ -28,6 +28,12 @@ public class DisplaySceneImpl implements DisplayScene
return _model.sceneId;
}
// documentation inherited
public String getName ()
{
return _model.sceneName;
}
// documentation inherited
public int getVersion ()
{
@@ -1,5 +1,5 @@
//
// $Id: SceneModel.java,v 1.5 2001/12/12 02:47:17 mdb Exp $
// $Id: SceneModel.java,v 1.6 2001/12/12 19:06:15 mdb Exp $
package com.threerings.whirled.data;
@@ -27,6 +27,9 @@ public class SceneModel
/** This scene's unique identifier. */
public int sceneId;
/** The human readable name of this scene. */
public String sceneName;
/** The version number of this scene. Versions are incremented
* whenever modifications are made to a scene so that clients can
* determine whether or not they have the latest version of a
@@ -42,6 +45,7 @@ public class SceneModel
throws IOException
{
out.writeInt(sceneId);
out.writeUTF(sceneName);
out.writeInt(version);
int nlength = neighborIds.length;
out.writeInt(nlength);
@@ -55,6 +59,7 @@ public class SceneModel
throws IOException
{
sceneId = in.readInt();
sceneName = in.readUTF();
version = in.readInt();
int nlength = in.readInt();
neighborIds = new int[nlength];
@@ -89,6 +94,7 @@ public class SceneModel
protected void toString (StringBuffer buf)
{
buf.append("sceneId=").append(sceneId);
buf.append(", name=").append(sceneName);
buf.append(", version=").append(version);
buf.append(", neighborIds=").append(StringUtil.toString(neighborIds));
}
@@ -109,6 +115,7 @@ public class SceneModel
protected static void populateBlankSceneModel (SceneModel model)
{
model.sceneId = -1;
model.sceneName = "<blank>";
model.version = 0;
model.neighborIds = new int[0];
}
@@ -1,5 +1,5 @@
//
// $Id: EditableScene.java,v 1.3 2001/12/05 03:38:09 mdb Exp $
// $Id: EditableScene.java,v 1.4 2001/12/12 19:06:15 mdb Exp $
package com.threerings.whirled.tools;
@@ -32,6 +32,11 @@ public interface EditableScene extends DisplayScene
*/
public void setId (int sceneId);
/**
* Sets the human readable name of this scene.
*/
public void setName (String name);
/**
* Sets this scene's version number.
*/
@@ -42,16 +47,6 @@ public interface EditableScene extends DisplayScene
*/
public void setNeighborIds (int[] neighborIds);
/**
* Returns the human readable name of this scene.
*/
public String getName ();
/**
* Setse the human readable name of this scene.
*/
public void setName (String name);
/**
* Returns the names of the neighbors of this scene.
*/
@@ -1,5 +1,5 @@
//
// $Id: EditableSceneImpl.java,v 1.5 2001/12/05 08:45:06 mdb Exp $
// $Id: EditableSceneImpl.java,v 1.6 2001/12/12 19:06:15 mdb Exp $
package com.threerings.whirled.tools;
@@ -50,6 +50,12 @@ public class EditableSceneImpl implements EditableScene
return _delegate.getId();
}
// documentation inherited
public String getName ()
{
return _delegate.getName();
}
// documentation inherited
public int getVersion ()
{
@@ -74,6 +80,12 @@ public class EditableSceneImpl implements EditableScene
_model.sceneId = sceneId;
}
// documentation inherited
public void setName (String name)
{
_model.sceneName = name;
}
// documentation inherited
public void setVersion (int version)
{
@@ -86,18 +98,6 @@ public class EditableSceneImpl implements EditableScene
_model.neighborIds = neighborIds;
}
// documentation inherited
public String getName ()
{
return _emodel.sceneName;
}
// documentation inherited
public void setName (String name)
{
_emodel.sceneName = name;
}
// documentation inherited
public ArrayList getNeighborNames ()
{
@@ -1,5 +1,5 @@
//
// $Id: EditableSceneModel.java,v 1.3 2001/12/12 02:47:17 mdb Exp $
// $Id: EditableSceneModel.java,v 1.4 2001/12/12 19:06:15 mdb Exp $
package com.threerings.whirled.tools;
@@ -17,9 +17,6 @@ public class EditableSceneModel
/** The scene model that we extend. */
public SceneModel sceneModel;
/** The human readable name of this scene. */
public String sceneName;
/** The human readable name of this scene's neighbors. */
public ArrayList neighborNames;
@@ -65,7 +62,6 @@ public class EditableSceneModel
*/
protected void toString (StringBuffer buf)
{
buf.append(", sceneName=").append(sceneName);
buf.append(", neighborNames=").
append(StringUtil.toString(neighborNames));
}
@@ -86,7 +82,6 @@ public class EditableSceneModel
*/
protected static void populateBlankSceneModel (EditableSceneModel model)
{
model.sceneName = "";
model.neighborNames = new ArrayList();
}
}