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:
@@ -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;
|
package com.threerings.whirled.client;
|
||||||
|
|
||||||
@@ -26,6 +26,11 @@ public interface DisplayScene
|
|||||||
*/
|
*/
|
||||||
public int getId ();
|
public int getId ();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Returns the name of this scene.
|
||||||
|
*/
|
||||||
|
public String getName ();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns the version number of this scene.
|
* 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;
|
package com.threerings.whirled.client;
|
||||||
|
|
||||||
@@ -28,6 +28,12 @@ public class DisplaySceneImpl implements DisplayScene
|
|||||||
return _model.sceneId;
|
return _model.sceneId;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// documentation inherited
|
||||||
|
public String getName ()
|
||||||
|
{
|
||||||
|
return _model.sceneName;
|
||||||
|
}
|
||||||
|
|
||||||
// documentation inherited
|
// documentation inherited
|
||||||
public int getVersion ()
|
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;
|
package com.threerings.whirled.data;
|
||||||
|
|
||||||
@@ -27,6 +27,9 @@ public class SceneModel
|
|||||||
/** This scene's unique identifier. */
|
/** This scene's unique identifier. */
|
||||||
public int sceneId;
|
public int sceneId;
|
||||||
|
|
||||||
|
/** The human readable name of this scene. */
|
||||||
|
public String sceneName;
|
||||||
|
|
||||||
/** The version number of this scene. Versions are incremented
|
/** The version number of this scene. Versions are incremented
|
||||||
* whenever modifications are made to a scene so that clients can
|
* whenever modifications are made to a scene so that clients can
|
||||||
* determine whether or not they have the latest version of a
|
* determine whether or not they have the latest version of a
|
||||||
@@ -42,6 +45,7 @@ public class SceneModel
|
|||||||
throws IOException
|
throws IOException
|
||||||
{
|
{
|
||||||
out.writeInt(sceneId);
|
out.writeInt(sceneId);
|
||||||
|
out.writeUTF(sceneName);
|
||||||
out.writeInt(version);
|
out.writeInt(version);
|
||||||
int nlength = neighborIds.length;
|
int nlength = neighborIds.length;
|
||||||
out.writeInt(nlength);
|
out.writeInt(nlength);
|
||||||
@@ -55,6 +59,7 @@ public class SceneModel
|
|||||||
throws IOException
|
throws IOException
|
||||||
{
|
{
|
||||||
sceneId = in.readInt();
|
sceneId = in.readInt();
|
||||||
|
sceneName = in.readUTF();
|
||||||
version = in.readInt();
|
version = in.readInt();
|
||||||
int nlength = in.readInt();
|
int nlength = in.readInt();
|
||||||
neighborIds = new int[nlength];
|
neighborIds = new int[nlength];
|
||||||
@@ -89,6 +94,7 @@ public class SceneModel
|
|||||||
protected void toString (StringBuffer buf)
|
protected void toString (StringBuffer buf)
|
||||||
{
|
{
|
||||||
buf.append("sceneId=").append(sceneId);
|
buf.append("sceneId=").append(sceneId);
|
||||||
|
buf.append(", name=").append(sceneName);
|
||||||
buf.append(", version=").append(version);
|
buf.append(", version=").append(version);
|
||||||
buf.append(", neighborIds=").append(StringUtil.toString(neighborIds));
|
buf.append(", neighborIds=").append(StringUtil.toString(neighborIds));
|
||||||
}
|
}
|
||||||
@@ -109,6 +115,7 @@ public class SceneModel
|
|||||||
protected static void populateBlankSceneModel (SceneModel model)
|
protected static void populateBlankSceneModel (SceneModel model)
|
||||||
{
|
{
|
||||||
model.sceneId = -1;
|
model.sceneId = -1;
|
||||||
|
model.sceneName = "<blank>";
|
||||||
model.version = 0;
|
model.version = 0;
|
||||||
model.neighborIds = new int[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;
|
package com.threerings.whirled.tools;
|
||||||
|
|
||||||
@@ -32,6 +32,11 @@ public interface EditableScene extends DisplayScene
|
|||||||
*/
|
*/
|
||||||
public void setId (int sceneId);
|
public void setId (int sceneId);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Sets the human readable name of this scene.
|
||||||
|
*/
|
||||||
|
public void setName (String name);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Sets this scene's version number.
|
* Sets this scene's version number.
|
||||||
*/
|
*/
|
||||||
@@ -42,16 +47,6 @@ public interface EditableScene extends DisplayScene
|
|||||||
*/
|
*/
|
||||||
public void setNeighborIds (int[] neighborIds);
|
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.
|
* 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;
|
package com.threerings.whirled.tools;
|
||||||
|
|
||||||
@@ -50,6 +50,12 @@ public class EditableSceneImpl implements EditableScene
|
|||||||
return _delegate.getId();
|
return _delegate.getId();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// documentation inherited
|
||||||
|
public String getName ()
|
||||||
|
{
|
||||||
|
return _delegate.getName();
|
||||||
|
}
|
||||||
|
|
||||||
// documentation inherited
|
// documentation inherited
|
||||||
public int getVersion ()
|
public int getVersion ()
|
||||||
{
|
{
|
||||||
@@ -74,6 +80,12 @@ public class EditableSceneImpl implements EditableScene
|
|||||||
_model.sceneId = sceneId;
|
_model.sceneId = sceneId;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// documentation inherited
|
||||||
|
public void setName (String name)
|
||||||
|
{
|
||||||
|
_model.sceneName = name;
|
||||||
|
}
|
||||||
|
|
||||||
// documentation inherited
|
// documentation inherited
|
||||||
public void setVersion (int version)
|
public void setVersion (int version)
|
||||||
{
|
{
|
||||||
@@ -86,18 +98,6 @@ public class EditableSceneImpl implements EditableScene
|
|||||||
_model.neighborIds = neighborIds;
|
_model.neighborIds = neighborIds;
|
||||||
}
|
}
|
||||||
|
|
||||||
// documentation inherited
|
|
||||||
public String getName ()
|
|
||||||
{
|
|
||||||
return _emodel.sceneName;
|
|
||||||
}
|
|
||||||
|
|
||||||
// documentation inherited
|
|
||||||
public void setName (String name)
|
|
||||||
{
|
|
||||||
_emodel.sceneName = name;
|
|
||||||
}
|
|
||||||
|
|
||||||
// documentation inherited
|
// documentation inherited
|
||||||
public ArrayList getNeighborNames ()
|
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;
|
package com.threerings.whirled.tools;
|
||||||
|
|
||||||
@@ -17,9 +17,6 @@ public class EditableSceneModel
|
|||||||
/** The scene model that we extend. */
|
/** The scene model that we extend. */
|
||||||
public SceneModel sceneModel;
|
public SceneModel sceneModel;
|
||||||
|
|
||||||
/** The human readable name of this scene. */
|
|
||||||
public String sceneName;
|
|
||||||
|
|
||||||
/** The human readable name of this scene's neighbors. */
|
/** The human readable name of this scene's neighbors. */
|
||||||
public ArrayList neighborNames;
|
public ArrayList neighborNames;
|
||||||
|
|
||||||
@@ -65,7 +62,6 @@ public class EditableSceneModel
|
|||||||
*/
|
*/
|
||||||
protected void toString (StringBuffer buf)
|
protected void toString (StringBuffer buf)
|
||||||
{
|
{
|
||||||
buf.append(", sceneName=").append(sceneName);
|
|
||||||
buf.append(", neighborNames=").
|
buf.append(", neighborNames=").
|
||||||
append(StringUtil.toString(neighborNames));
|
append(StringUtil.toString(neighborNames));
|
||||||
}
|
}
|
||||||
@@ -86,7 +82,6 @@ public class EditableSceneModel
|
|||||||
*/
|
*/
|
||||||
protected static void populateBlankSceneModel (EditableSceneModel model)
|
protected static void populateBlankSceneModel (EditableSceneModel model)
|
||||||
{
|
{
|
||||||
model.sceneName = "";
|
|
||||||
model.neighborNames = new ArrayList();
|
model.neighborNames = new ArrayList();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user