Separate the notion of tile passability from tile objects since

passability is specific to the miso layer.


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@405 542714f4-19e9-0310-aa3c-eee0fc999fb1
This commit is contained in:
Walter Korman
2001-10-08 21:04:26 +00:00
parent d7fb56d203
commit 95ba5ef9cf
14 changed files with 293 additions and 213 deletions
@@ -1,5 +1,5 @@
//
// $Id: DisplayMisoSceneImpl.java,v 1.37 2001/09/28 01:46:10 mdb Exp $
// $Id: DisplayMisoSceneImpl.java,v 1.38 2001/10/08 21:04:25 shaper Exp $
package com.threerings.miso.scene;
@@ -10,12 +10,12 @@ import java.util.List;
import com.samskivert.util.StringUtil;
import com.threerings.media.tile.Tile;
import com.threerings.media.tile.TileManager;
import com.threerings.whirled.data.Scene;
import com.threerings.miso.Log;
import com.threerings.miso.scene.util.ClusterUtil;
import com.threerings.miso.tile.MisoTile;
/**
* A scene object represents the data model corresponding to a single
@@ -47,8 +47,8 @@ public class MisoSceneImpl implements EditableMisoScene
_clusters = new ArrayList();
_portals = new ArrayList();
_tiles = new Tile[_model.scenewid][_model.scenehei][NUM_LAYERS];
_deftile = _tilemgr.getTile(deftsid, deftid);
_tiles = new MisoTile[_model.scenewid][_model.scenehei][NUM_LAYERS];
_deftile = (MisoTile)_tilemgr.getTile(deftsid, deftid);
for (int xx = 0; xx < _model.scenewid; xx++) {
for (int yy = 0; yy < _model.scenehei; yy++) {
for (int ii = 0; ii < NUM_LAYERS; ii++) {
@@ -73,7 +73,7 @@ public class MisoSceneImpl implements EditableMisoScene
public MisoSceneImpl (IsoSceneViewModel model, TileManager tilemgr,
String name, ArrayList locations,
ArrayList clusters, ArrayList portals,
Tile[][][] tiles)
MisoTile[][][] tiles)
{
_model = model;
_tilemgr = tilemgr;
@@ -110,13 +110,13 @@ public class MisoSceneImpl implements EditableMisoScene
}
// documentation inherited
public Tile[][][] getTiles ()
public MisoTile[][][] getTiles ()
{
return _tiles;
}
// documentation inherited
public Tile getDefaultTile ()
public MisoTile getDefaultTile ()
{
return _deftile;
}
@@ -261,7 +261,7 @@ public class MisoSceneImpl implements EditableMisoScene
protected int _version;
/** The tiles comprising the scene. */
public Tile[][][] _tiles;
public MisoTile[][][] _tiles;
/** The default entrance portal. */
protected Portal _entrance;
@@ -276,7 +276,7 @@ public class MisoSceneImpl implements EditableMisoScene
protected ArrayList _portals;
/** The default tile for the base layer in the scene. */
protected Tile _deftile;
protected MisoTile _deftile;
/** The iso scene view data model. */
protected IsoSceneViewModel _model;
@@ -1,11 +1,11 @@
//
// $Id: MisoScene.java,v 1.3 2001/10/05 23:58:36 mdb Exp $
// $Id: MisoScene.java,v 1.4 2001/10/08 21:04:25 shaper Exp $
package com.threerings.miso.scene;
import java.util.List;
import com.threerings.media.tile.Tile;
import com.threerings.miso.tile.MisoTile;
/**
* A scene object represents the data model corresponding to a single
@@ -42,12 +42,12 @@ public interface MisoScene
/**
* Return the tiles that comprise this scene.
*/
public Tile[][][] getTiles ();
public MisoTile[][][] getTiles ();
/**
* Return the default tile for the base layer of the scene.
*/
public Tile getDefaultTile ();
public MisoTile getDefaultTile ();
/**
* Return the locations in this scene. The locations list should
@@ -1,9 +1,9 @@
//
// $Id: Traverser.java,v 1.2 2001/08/16 23:14:21 mdb Exp $
// $Id: Traverser.java,v 1.3 2001/10/08 21:04:25 shaper Exp $
package com.threerings.miso.scene;
import com.threerings.media.tile.Tile;
import com.threerings.miso.tile.MisoTile;
/**
* The <code>Traverser</code> interface should be implemented by
@@ -21,5 +21,5 @@ public interface Traverser
*
* @return whether the tile is traversable.
*/
public boolean canTraverse (Tile tile);
public boolean canTraverse (MisoTile tile);
}
@@ -1,16 +1,16 @@
//
// $Id: AStarPathUtil.java,v 1.4 2001/08/23 00:55:30 shaper Exp $
// $Id: AStarPathUtil.java,v 1.5 2001/10/08 21:04:25 shaper Exp $
package com.threerings.miso.scene.util;
import java.awt.Point;
import java.util.*;
import com.threerings.media.tile.Tile;
import com.threerings.media.util.MathUtil;
import com.threerings.miso.Log;
import com.threerings.miso.scene.Traverser;
import com.threerings.miso.tile.MisoTile;
/**
* The <code>AStarPathUtil</code> class provides a facility for
@@ -43,7 +43,7 @@ public class AStarPathUtil
* @return the list of points in the path.
*/
public static List getPath (
Tile tiles[][][], int tilewid, int tilehei, Traverser trav,
MisoTile tiles[][][], int tilewid, int tilehei, Traverser trav,
int ax, int ay, int bx, int by)
{
AStarInfo info = new AStarInfo(tiles, tilewid, tilehei, trav, bx, by);
@@ -198,7 +198,7 @@ public class AStarPathUtil
class AStarInfo
{
/** The array of tiles being traversed. */
public Tile tiles[][][];
public MisoTile tiles[][][];
/** The tile array dimensions. */
public int tilewid, tilehei;
@@ -219,7 +219,7 @@ class AStarInfo
public int destx, desty;
public AStarInfo (
Tile tiles[][][], int tilewid, int tilehei, Traverser trav,
MisoTile tiles[][][], int tilewid, int tilehei, Traverser trav,
int destx, int desty)
{
// save off references