Minor scene changes.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@342 542714f4-19e9-0310-aa3c-eee0fc999fb1
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
//
|
||||
// $Id: DisplayMisoSceneImpl.java,v 1.33 2001/08/29 19:50:46 shaper Exp $
|
||||
// $Id: DisplayMisoSceneImpl.java,v 1.34 2001/09/21 00:21:40 mdb Exp $
|
||||
|
||||
package com.threerings.miso.scene;
|
||||
|
||||
@@ -108,6 +108,103 @@ public class MisoScene implements Scene
|
||||
this.tiles = tiles;
|
||||
}
|
||||
|
||||
// documentation inherited
|
||||
public String getName ()
|
||||
{
|
||||
return _name;
|
||||
}
|
||||
|
||||
// documentation inherited
|
||||
public int getId ()
|
||||
{
|
||||
return _sid;
|
||||
}
|
||||
|
||||
// documentation inherited
|
||||
public int getVersion ()
|
||||
{
|
||||
// fake it for now
|
||||
return 1;
|
||||
}
|
||||
|
||||
// documentation inherited
|
||||
public int[] getNeighborIds ()
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* Return the default tile for the base layer of the scene.
|
||||
*/
|
||||
public Tile getDefaultTile ()
|
||||
{
|
||||
return _deftile;
|
||||
}
|
||||
|
||||
/**
|
||||
* Return the scene locations list.
|
||||
*/
|
||||
public ArrayList getLocations ()
|
||||
{
|
||||
return _locations;
|
||||
}
|
||||
|
||||
/**
|
||||
* Return the cluster list.
|
||||
*/
|
||||
public ArrayList getClusters ()
|
||||
{
|
||||
return _clusters;
|
||||
}
|
||||
|
||||
/**
|
||||
* Return the scene portals list.
|
||||
*/
|
||||
public ArrayList getPortals ()
|
||||
{
|
||||
return _portals;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set the default entrance portal for this scene.
|
||||
*
|
||||
* @param entrance the entrance portal.
|
||||
*/
|
||||
public void setEntrance (Portal entrance)
|
||||
{
|
||||
_entrance = entrance;
|
||||
}
|
||||
|
||||
/**
|
||||
* Return the number of clusters in the scene.
|
||||
*/
|
||||
public int getNumClusters ()
|
||||
{
|
||||
return _clusters.size();
|
||||
}
|
||||
|
||||
/**
|
||||
* Return the number of actual (non-null) tiles present in the
|
||||
* specified tile layer for this scene.
|
||||
*/
|
||||
public int getNumLayerTiles (int lnum)
|
||||
{
|
||||
if (lnum == LAYER_BASE) {
|
||||
return _model.scenewid * _model.scenehei;
|
||||
}
|
||||
|
||||
int numTiles = 0;
|
||||
for (int xx = 0; xx < _model.scenewid; xx++) {
|
||||
for (int yy = 0; yy < _model.scenehei; yy++) {
|
||||
if (tiles[xx][yy] != null) {
|
||||
numTiles++;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return numTiles;
|
||||
}
|
||||
|
||||
/**
|
||||
* Return the cluster index number the given location is in, or -1
|
||||
* if the location is not in any cluster.
|
||||
@@ -203,16 +300,6 @@ public class MisoScene implements Scene
|
||||
_portals.remove(loc);
|
||||
}
|
||||
|
||||
/**
|
||||
* Set the default entrance portal for this scene.
|
||||
*
|
||||
* @param entrance the entrance portal.
|
||||
*/
|
||||
public void setEntrance (Portal entrance)
|
||||
{
|
||||
_entrance = entrance;
|
||||
}
|
||||
|
||||
/**
|
||||
* Return the portal with the given name, or null if the portal
|
||||
* isn't found in the portal list.
|
||||
@@ -231,102 +318,6 @@ public class MisoScene implements Scene
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* Return the scene name.
|
||||
*/
|
||||
public String getName ()
|
||||
{
|
||||
return _name;
|
||||
}
|
||||
|
||||
/**
|
||||
* Return the scene identifier.
|
||||
*/
|
||||
public int getId ()
|
||||
{
|
||||
return _sid;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns this scene's version number (which is incremented when it
|
||||
* is modified and stored into the scene repository).
|
||||
*/
|
||||
public int getVersion ()
|
||||
{
|
||||
// fake it for now
|
||||
return 1;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the scene ids of the portals from this scene.
|
||||
*/
|
||||
public int[] getPortalIds ()
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* Return the scene locations list.
|
||||
*/
|
||||
public ArrayList getLocations ()
|
||||
{
|
||||
return _locations;
|
||||
}
|
||||
|
||||
/**
|
||||
* Return the cluster list.
|
||||
*/
|
||||
public ArrayList getClusters ()
|
||||
{
|
||||
return _clusters;
|
||||
}
|
||||
|
||||
/**
|
||||
* Return the scene portals list.
|
||||
*/
|
||||
public ArrayList getPortals ()
|
||||
{
|
||||
return _portals;
|
||||
}
|
||||
|
||||
/**
|
||||
* Return the number of clusters in the scene.
|
||||
*/
|
||||
public int getNumClusters ()
|
||||
{
|
||||
return _clusters.size();
|
||||
}
|
||||
|
||||
/**
|
||||
* Return the number of actual (non-null) tiles present in the
|
||||
* specified tile layer for this scene.
|
||||
*/
|
||||
public int getNumLayerTiles (int lnum)
|
||||
{
|
||||
if (lnum == LAYER_BASE) {
|
||||
return _model.scenewid * _model.scenehei;
|
||||
}
|
||||
|
||||
int numTiles = 0;
|
||||
for (int xx = 0; xx < _model.scenewid; xx++) {
|
||||
for (int yy = 0; yy < _model.scenehei; yy++) {
|
||||
if (tiles[xx][yy] != null) {
|
||||
numTiles++;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return numTiles;
|
||||
}
|
||||
|
||||
/**
|
||||
* Return the default tile for the base layer of the scene.
|
||||
*/
|
||||
public Tile getDefaultTile ()
|
||||
{
|
||||
return _deftile;
|
||||
}
|
||||
|
||||
/**
|
||||
* Return a string representation of this Scene object.
|
||||
*/
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
//
|
||||
// $Id: DummyScene.java,v 1.2 2001/08/16 18:05:17 shaper Exp $
|
||||
// $Id: DummyScene.java,v 1.3 2001/09/21 00:21:40 mdb Exp $
|
||||
|
||||
package com.threerings.whirled.client.test;
|
||||
|
||||
@@ -22,7 +22,12 @@ public class DummyScene implements Scene
|
||||
return 1;
|
||||
}
|
||||
|
||||
public int[] getPortalIds ()
|
||||
public String getName ()
|
||||
{
|
||||
return "scene";
|
||||
}
|
||||
|
||||
public int[] getNeighborIds ()
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
//
|
||||
// $Id: Scene.java,v 1.2 2001/08/16 18:05:17 shaper Exp $
|
||||
// $Id: Scene.java,v 1.3 2001/09/21 00:21:40 mdb Exp $
|
||||
|
||||
package com.threerings.whirled.data;
|
||||
|
||||
@@ -9,9 +9,28 @@ package com.threerings.whirled.data;
|
||||
*/
|
||||
public interface Scene
|
||||
{
|
||||
/**
|
||||
* Returns the scene's unique identifier.
|
||||
*/
|
||||
public int getId ();
|
||||
|
||||
/**
|
||||
* Returns the scene's version. The version should be updated every
|
||||
* time the scene is modified and stored back to the repository. This
|
||||
* allows a client to determine whether or not they need an updated
|
||||
* version of the scene for their local cache.
|
||||
*/
|
||||
public int getVersion ();
|
||||
|
||||
public int[] getPortalIds ();
|
||||
/**
|
||||
* Returns the scene's name. Every scene has a descriptive name.
|
||||
*/
|
||||
public String getName ();
|
||||
|
||||
/**
|
||||
* Returns the scene ids of all scenes that neighbor this scene. A
|
||||
* neighboring scene is one to which the user can traverse from this
|
||||
* scene and vice versa.
|
||||
*/
|
||||
public int[] getNeighborIds ();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user