Changed MisoTile to BaseTile.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@654 542714f4-19e9-0310-aa3c-eee0fc999fb1
This commit is contained in:
@@ -1,11 +1,11 @@
|
||||
//
|
||||
// $Id: DisplayMisoScene.java,v 1.1 2001/11/18 04:09:22 mdb Exp $
|
||||
// $Id: DisplayMisoScene.java,v 1.2 2001/11/27 22:17:42 mdb Exp $
|
||||
|
||||
package com.threerings.miso.scene;
|
||||
|
||||
import com.threerings.media.tile.ObjectTileLayer;
|
||||
import com.threerings.media.tile.TileLayer;
|
||||
import com.threerings.miso.tile.MisoTileLayer;
|
||||
import com.threerings.miso.tile.BaseTileLayer;
|
||||
|
||||
/**
|
||||
* Makes available the information from the {@link MisoSceneModel} in a
|
||||
@@ -19,7 +19,7 @@ public interface DisplayMisoScene
|
||||
* Returns the tiles that comprise the base layer of this scene. This
|
||||
* layer is read-only and not to be modified.
|
||||
*/
|
||||
public MisoTileLayer getBaseLayer ();
|
||||
public BaseTileLayer getBaseLayer ();
|
||||
|
||||
/**
|
||||
* Returns the tiles that comprise the fringe layer of this scene.
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
//
|
||||
// $Id: DisplayMisoSceneImpl.java,v 1.44 2001/11/18 04:09:22 mdb Exp $
|
||||
// $Id: DisplayMisoSceneImpl.java,v 1.45 2001/11/27 22:17:42 mdb Exp $
|
||||
|
||||
package com.threerings.miso.scene;
|
||||
|
||||
@@ -12,8 +12,8 @@ import com.threerings.media.tile.TileLayer;
|
||||
import com.threerings.media.tile.TileManager;
|
||||
|
||||
import com.threerings.miso.Log;
|
||||
import com.threerings.miso.tile.MisoTile;
|
||||
import com.threerings.miso.tile.MisoTileLayer;
|
||||
import com.threerings.miso.tile.BaseTile;
|
||||
import com.threerings.miso.tile.BaseTileLayer;
|
||||
import com.threerings.miso.tile.ShadowTile;
|
||||
|
||||
/**
|
||||
@@ -40,7 +40,7 @@ public class DisplayMisoSceneImpl
|
||||
int shei = model.height;
|
||||
|
||||
// create the individual tile layer objects
|
||||
_base = new MisoTileLayer(new MisoTile[swid*shei], swid, shei);
|
||||
_base = new BaseTileLayer(new BaseTile[swid*shei], swid, shei);
|
||||
_fringe = new TileLayer(new Tile[swid*shei], swid, shei);
|
||||
_object = new ObjectTileLayer(new ObjectTile[swid*shei], swid, shei);
|
||||
|
||||
@@ -55,10 +55,10 @@ public class DisplayMisoSceneImpl
|
||||
// this is a bit magical, but the tile manager will
|
||||
// fetch tiles from the tileset repository and the
|
||||
// tile set id from which we request this tile must
|
||||
// map to a miso tile as provided by the repository,
|
||||
// so we just cast it to a miso tile and know that all
|
||||
// map to a base tile as provided by the repository,
|
||||
// so we just cast it to a base tile and know that all
|
||||
// is well
|
||||
MisoTile mtile = (MisoTile)tmgr.getTile(tsid, tid);
|
||||
BaseTile mtile = (BaseTile)tmgr.getTile(tsid, tid);
|
||||
_base.setTile(column, row, mtile);
|
||||
}
|
||||
|
||||
@@ -101,7 +101,7 @@ public class DisplayMisoSceneImpl
|
||||
}
|
||||
|
||||
// documentation inherited
|
||||
public MisoTileLayer getBaseLayer ()
|
||||
public BaseTileLayer getBaseLayer ()
|
||||
{
|
||||
return _base;
|
||||
}
|
||||
@@ -150,7 +150,7 @@ public class DisplayMisoSceneImpl
|
||||
* @param y the tile y-coordinate.
|
||||
* @param stamp the tile to place in the object footprint.
|
||||
*/
|
||||
protected void setObjectTileFootprint (int x, int y, MisoTile stamp)
|
||||
protected void setObjectTileFootprint (int x, int y, BaseTile stamp)
|
||||
{
|
||||
ObjectTile tile = _object.getTile(y, x);
|
||||
int endx = Math.max(0, (x - tile.getBaseWidth() + 1));
|
||||
@@ -164,7 +164,7 @@ public class DisplayMisoSceneImpl
|
||||
}
|
||||
|
||||
/** The base layer of tiles. */
|
||||
protected MisoTileLayer _base;
|
||||
protected BaseTileLayer _base;
|
||||
|
||||
/** The fringe layer of tiles. */
|
||||
protected TileLayer _fringe;
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
//
|
||||
// $Id: IsoSceneView.java,v 1.72 2001/11/18 04:09:22 mdb Exp $
|
||||
// $Id: IsoSceneView.java,v 1.73 2001/11/27 22:17:42 mdb Exp $
|
||||
|
||||
package com.threerings.miso.scene;
|
||||
|
||||
@@ -34,7 +34,7 @@ import com.threerings.miso.Log;
|
||||
import com.threerings.miso.scene.DirtyItemList.DirtyItem;
|
||||
import com.threerings.miso.scene.util.AStarPathUtil;
|
||||
import com.threerings.miso.scene.util.IsoUtil;
|
||||
import com.threerings.miso.tile.MisoTileLayer;
|
||||
import com.threerings.miso.tile.BaseTileLayer;
|
||||
|
||||
/**
|
||||
* The iso scene view provides an isometric view of a particular
|
||||
@@ -217,7 +217,7 @@ public class IsoSceneView implements SceneView
|
||||
*/
|
||||
protected void renderTiles (Graphics2D gfx)
|
||||
{
|
||||
MisoTileLayer base = _scene.getBaseLayer();
|
||||
BaseTileLayer base = _scene.getBaseLayer();
|
||||
TileLayer fringe = _scene.getFringeLayer();
|
||||
|
||||
// render the base and fringe layers
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
//
|
||||
// $Id: MisoCharacterSprite.java,v 1.2 2001/11/18 04:09:22 mdb Exp $
|
||||
// $Id: MisoCharacterSprite.java,v 1.3 2001/11/27 22:17:42 mdb Exp $
|
||||
|
||||
package com.threerings.miso.scene;
|
||||
|
||||
import com.threerings.cast.CharacterSprite;
|
||||
|
||||
import com.threerings.miso.tile.MisoTile;
|
||||
import com.threerings.miso.tile.BaseTile;
|
||||
|
||||
/**
|
||||
* The miso character sprite extends the basic character sprite to
|
||||
@@ -21,7 +21,7 @@ public class MisoCharacterSprite
|
||||
implements Traverser
|
||||
{
|
||||
// documentation inherited
|
||||
public boolean canTraverse (MisoTile tile)
|
||||
public boolean canTraverse (BaseTile tile)
|
||||
{
|
||||
// by default, passability is solely the province of the tile
|
||||
return tile.isPassable();
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
//
|
||||
// $Id: Traverser.java,v 1.3 2001/10/08 21:04:25 shaper Exp $
|
||||
// $Id: Traverser.java,v 1.4 2001/11/27 22:17:42 mdb Exp $
|
||||
|
||||
package com.threerings.miso.scene;
|
||||
|
||||
import com.threerings.miso.tile.MisoTile;
|
||||
import com.threerings.miso.tile.BaseTile;
|
||||
|
||||
/**
|
||||
* 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 (MisoTile tile);
|
||||
public boolean canTraverse (BaseTile tile);
|
||||
}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
//
|
||||
// $Id: AStarPathUtil.java,v 1.8 2001/11/18 04:09:22 mdb Exp $
|
||||
// $Id: AStarPathUtil.java,v 1.9 2001/11/27 22:17:42 mdb Exp $
|
||||
|
||||
package com.threerings.miso.scene.util;
|
||||
|
||||
@@ -10,8 +10,8 @@ import com.threerings.media.util.MathUtil;
|
||||
|
||||
import com.threerings.miso.Log;
|
||||
import com.threerings.miso.scene.Traverser;
|
||||
import com.threerings.miso.tile.MisoTile;
|
||||
import com.threerings.miso.tile.MisoTileLayer;
|
||||
import com.threerings.miso.tile.BaseTile;
|
||||
import com.threerings.miso.tile.BaseTileLayer;
|
||||
|
||||
/**
|
||||
* The <code>AStarPathUtil</code> class provides a facility for
|
||||
@@ -44,7 +44,7 @@ public class AStarPathUtil
|
||||
* @return the list of points in the path.
|
||||
*/
|
||||
public static List getPath (
|
||||
MisoTileLayer tiles, int tilewid, int tilehei, Traverser trav,
|
||||
BaseTileLayer 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);
|
||||
@@ -254,7 +254,7 @@ public class AStarPathUtil
|
||||
class AStarInfo
|
||||
{
|
||||
/** The tile layer being traversed. */
|
||||
public MisoTileLayer tiles;
|
||||
public BaseTileLayer tiles;
|
||||
|
||||
/** The tile array dimensions. */
|
||||
public int tilewid, tilehei;
|
||||
@@ -275,7 +275,7 @@ class AStarInfo
|
||||
public int destx, desty;
|
||||
|
||||
public AStarInfo (
|
||||
MisoTileLayer tiles, int tilewid, int tilehei, Traverser trav,
|
||||
BaseTileLayer tiles, int tilewid, int tilehei, Traverser trav,
|
||||
int destx, int desty)
|
||||
{
|
||||
// save off references
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
//
|
||||
// $Id: BaseTile.java,v 1.2 2001/11/18 04:09:22 mdb Exp $
|
||||
// $Id: BaseTile.java,v 1.3 2001/11/27 22:17:42 mdb Exp $
|
||||
|
||||
package com.threerings.miso.tile;
|
||||
|
||||
@@ -7,25 +7,25 @@ import java.awt.Image;
|
||||
import com.threerings.media.tile.Tile;
|
||||
|
||||
/**
|
||||
* Extends the base tile class to add support for tile passability.
|
||||
* Extends the tile class to add support for tile passability.
|
||||
*
|
||||
* @see MisoTileSet
|
||||
* @see BaseTileSet
|
||||
*/
|
||||
public class MisoTile extends Tile
|
||||
public class BaseTile extends Tile
|
||||
{
|
||||
/**
|
||||
* Constructs a new miso tile with the specified image. Passability
|
||||
* Constructs a new base tile with the specified image. Passability
|
||||
* will be assumed to be true.
|
||||
*/
|
||||
public MisoTile (Image image)
|
||||
public BaseTile (Image image)
|
||||
{
|
||||
super(image);
|
||||
}
|
||||
|
||||
/**
|
||||
* Constructs a new miso tile with the specified passability.
|
||||
* Constructs a new base tile with the specified passability.
|
||||
*/
|
||||
public MisoTile (Image image, boolean passable)
|
||||
public BaseTile (Image image, boolean passable)
|
||||
{
|
||||
super(image);
|
||||
_passable = passable;
|
||||
|
||||
@@ -1,31 +1,31 @@
|
||||
//
|
||||
// $Id: BaseTileLayer.java,v 1.2 2001/11/18 04:27:56 mdb Exp $
|
||||
// $Id: BaseTileLayer.java,v 1.3 2001/11/27 22:17:42 mdb Exp $
|
||||
|
||||
package com.threerings.miso.tile;
|
||||
|
||||
/**
|
||||
* The miso tile layer class is a convenience class provided to simplify
|
||||
* the management of a two-dimensional array of miso tiles. It takes care
|
||||
* The base tile layer class is a convenience class provided to simplify
|
||||
* the management of a two-dimensional array of base tiles. It takes care
|
||||
* of dereferencing the tile array efficiently with methods that the Java
|
||||
* compiler should inline, and prevents the caller from having to do the
|
||||
* indexing multiplication by hand every time.
|
||||
*
|
||||
* <p> This is equivalent to {@link com.threerings.media.tile.TileLayer}
|
||||
* except that it contains {@link MisoTile} instances. For efficiency's
|
||||
* except that it contains {@link BaseTile} instances. For efficiency's
|
||||
* sake, we don't extend that class but instead provide a direct
|
||||
* implementation.
|
||||
*/
|
||||
public final class MisoTileLayer
|
||||
public final class BaseTileLayer
|
||||
{
|
||||
/**
|
||||
* Constructs a miso tile layer instance with the supplied tiles,
|
||||
* Constructs a base tile layer instance with the supplied tiles,
|
||||
* width and height. The tiles should exist in row-major format (the
|
||||
* first row of tiles followed by the second and so on).
|
||||
*
|
||||
* @exception IllegalArgumentException thrown if the size of the tiles
|
||||
* array does not match the specified width and height.
|
||||
*/
|
||||
public MisoTileLayer (MisoTile[] tiles, int width, int height)
|
||||
public BaseTileLayer (BaseTile[] tiles, int width, int height)
|
||||
{
|
||||
// sanity check
|
||||
if (tiles.length != width*height) {
|
||||
@@ -59,7 +59,7 @@ public final class MisoTileLayer
|
||||
* is not done. Note that the parameters are column first, followed by
|
||||
* row (x, y order rather than row, column order).
|
||||
*/
|
||||
public MisoTile getTile (int column, int row)
|
||||
public BaseTile getTile (int column, int row)
|
||||
{
|
||||
return _tiles[row*_width+column];
|
||||
}
|
||||
@@ -69,13 +69,13 @@ public final class MisoTileLayer
|
||||
* not done. Note that the parameters are column first, followed by
|
||||
* row (x, y order rather than row, column order).
|
||||
*/
|
||||
public void setTile (int column, int row, MisoTile tile)
|
||||
public void setTile (int column, int row, BaseTile tile)
|
||||
{
|
||||
_tiles[row*_width+column] = tile;
|
||||
}
|
||||
|
||||
/** Our tiles array. */
|
||||
private MisoTile[] _tiles;
|
||||
private BaseTile[] _tiles;
|
||||
|
||||
/** The number of tiles in a row. */
|
||||
private int _width;
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
//
|
||||
// $Id: BaseTileSet.java,v 1.6 2001/11/18 04:09:22 mdb Exp $
|
||||
// $Id: BaseTileSet.java,v 1.7 2001/11/27 22:17:42 mdb Exp $
|
||||
|
||||
package com.threerings.miso.tile;
|
||||
|
||||
@@ -9,12 +9,12 @@ import com.threerings.media.tile.Tile;
|
||||
import com.threerings.media.tile.SwissArmyTileSet;
|
||||
|
||||
/**
|
||||
* The miso tile set extends the swiss army tile set to add support for
|
||||
* tile passability. Passability is used to determine whether {@link
|
||||
* The base tileset extends the swiss army tileset to add support for tile
|
||||
* passability. Passability is used to determine whether {@link
|
||||
* com.threerings.miso.scene.Traverser} objects can traverse a particular
|
||||
* tile in a scene.
|
||||
*/
|
||||
public class MisoTileSet extends SwissArmyTileSet
|
||||
public class BaseTileSet extends SwissArmyTileSet
|
||||
{
|
||||
/**
|
||||
* Sets the passability information for the tiles in this tileset.
|
||||
@@ -28,7 +28,7 @@ public class MisoTileSet extends SwissArmyTileSet
|
||||
// documentation inherited
|
||||
public Tile createTile (Image image, int tileIndex)
|
||||
{
|
||||
return new MisoTile(image, _passable[tileIndex]);
|
||||
return new BaseTile(image, _passable[tileIndex]);
|
||||
}
|
||||
|
||||
/** Whether each tile is passable. */
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
//
|
||||
// $Id: ShadowTile.java,v 1.3 2001/11/18 04:09:22 mdb Exp $
|
||||
// $Id: ShadowTile.java,v 1.4 2001/11/27 22:17:42 mdb Exp $
|
||||
|
||||
package com.threerings.miso.tile;
|
||||
|
||||
@@ -7,11 +7,11 @@ import java.awt.Graphics2D;
|
||||
import java.awt.Shape;
|
||||
|
||||
/**
|
||||
* The shadow tile extends miso tile to provide an always-impassable tile
|
||||
* The shadow tile extends base tile to provide an always-impassable tile
|
||||
* that has no display image. Shadow tiles are intended for placement in
|
||||
* the footprint of {@link com.threerings.media.tile.ObjectTile} objects.
|
||||
*/
|
||||
public class ShadowTile extends MisoTile
|
||||
public class ShadowTile extends BaseTile
|
||||
{
|
||||
/** The scene coordinates of the shadow tile's parent object tile. */
|
||||
public int ox, oy;
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
//
|
||||
// $Id: BaseTileSetRuleSet.java,v 1.4 2001/11/21 02:42:15 mdb Exp $
|
||||
// $Id: BaseTileSetRuleSet.java,v 1.5 2001/11/27 22:17:42 mdb Exp $
|
||||
|
||||
package com.threerings.miso.tools.tile.xml;
|
||||
|
||||
@@ -8,10 +8,10 @@ import org.apache.commons.digester.Digester;
|
||||
|
||||
import com.threerings.media.tile.TileSet;
|
||||
import com.threerings.media.tools.tile.xml.SwissArmyTileSetRuleSet;
|
||||
import com.threerings.miso.tile.MisoTileSet;
|
||||
import com.threerings.miso.tile.BaseTileSet;
|
||||
|
||||
/**
|
||||
* Parses {@link MisoTileSet} instances from a tileset description. A
|
||||
* Parses {@link BaseTileSet} instances from a tileset description. A
|
||||
* uniform tileset description looks like so:
|
||||
*
|
||||
* <pre>
|
||||
@@ -26,7 +26,7 @@ import com.threerings.miso.tile.MisoTileSet;
|
||||
* </tileset>
|
||||
* </pre>
|
||||
*/
|
||||
public class MisoTileSetRuleSet extends SwissArmyTileSetRuleSet
|
||||
public class BaseTileSetRuleSet extends SwissArmyTileSetRuleSet
|
||||
{
|
||||
// documentation inherited
|
||||
public void addRuleInstances (Digester digester)
|
||||
@@ -42,6 +42,6 @@ public class MisoTileSetRuleSet extends SwissArmyTileSetRuleSet
|
||||
protected TileSet createTileSet (Attributes attributes)
|
||||
{
|
||||
// we use uniform tilesets
|
||||
return new MisoTileSet();
|
||||
return new BaseTileSet();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,12 +1,12 @@
|
||||
//
|
||||
// $Id: EditableMisoScene.java,v 1.5 2001/11/18 04:09:23 mdb Exp $
|
||||
// $Id: EditableMisoScene.java,v 1.6 2001/11/27 22:17:42 mdb Exp $
|
||||
|
||||
package com.threerings.miso.tools;
|
||||
|
||||
import com.threerings.media.tile.ObjectTile;
|
||||
import com.threerings.media.tile.Tile;
|
||||
|
||||
import com.threerings.miso.tile.MisoTile;
|
||||
import com.threerings.miso.tile.BaseTile;
|
||||
import com.threerings.miso.scene.DisplayMisoScene;
|
||||
import com.threerings.miso.scene.MisoSceneModel;
|
||||
|
||||
@@ -25,7 +25,7 @@ public interface EditableMisoScene
|
||||
/**
|
||||
* Returns the default base tile.
|
||||
*/
|
||||
public MisoTile getDefaultBaseTile ();
|
||||
public BaseTile getDefaultBaseTile ();
|
||||
|
||||
/**
|
||||
* Sets the default base tile.
|
||||
@@ -35,7 +35,7 @@ public interface EditableMisoScene
|
||||
* com.threerings.media.tile.TileUtil#getFQTileId}) of the new default
|
||||
* base tile.
|
||||
*/
|
||||
public void setDefaultBaseTile (MisoTile defaultBaseTile, int fqTileId);
|
||||
public void setDefaultBaseTile (BaseTile defaultBaseTile, int fqTileId);
|
||||
|
||||
/**
|
||||
* Updates the tile at the specified location in the base layer.
|
||||
@@ -47,7 +47,7 @@ public interface EditableMisoScene
|
||||
* com.threerings.media.tile.TileUtil#getFQTileId}) of the new default
|
||||
* base tile.
|
||||
*/
|
||||
public void setBaseTile (int x, int y, MisoTile tile, int fqTileId);
|
||||
public void setBaseTile (int x, int y, BaseTile tile, int fqTileId);
|
||||
|
||||
/**
|
||||
* Updates the tile at the specified location in the fringe layer.
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
//
|
||||
// $Id: EditableMisoSceneImpl.java,v 1.1 2001/11/18 04:09:23 mdb Exp $
|
||||
// $Id: EditableMisoSceneImpl.java,v 1.2 2001/11/27 22:17:42 mdb Exp $
|
||||
|
||||
package com.threerings.miso.tools;
|
||||
|
||||
@@ -9,7 +9,7 @@ import com.threerings.media.tile.ObjectTile;
|
||||
import com.threerings.media.tile.Tile;
|
||||
import com.threerings.media.tile.TileManager;
|
||||
|
||||
import com.threerings.miso.tile.MisoTile;
|
||||
import com.threerings.miso.tile.BaseTile;
|
||||
|
||||
import com.threerings.miso.scene.DisplayMisoSceneImpl;
|
||||
import com.threerings.miso.scene.MisoSceneModel;
|
||||
@@ -44,20 +44,20 @@ public class EditableMisoSceneImpl
|
||||
}
|
||||
|
||||
// documentation inherited
|
||||
public MisoTile getDefaultBaseTile ()
|
||||
public BaseTile getDefaultBaseTile ()
|
||||
{
|
||||
return _defaultBaseTile;
|
||||
}
|
||||
|
||||
// documentation inherited
|
||||
public void setDefaultBaseTile (MisoTile defaultBaseTile, int fqTileId)
|
||||
public void setDefaultBaseTile (BaseTile defaultBaseTile, int fqTileId)
|
||||
{
|
||||
_defaultBaseTile = defaultBaseTile;
|
||||
_defaultBaseTileId = fqTileId;
|
||||
}
|
||||
|
||||
// documentation inherited
|
||||
public void setBaseTile (int x, int y, MisoTile tile, int fqTileId)
|
||||
public void setBaseTile (int x, int y, BaseTile tile, int fqTileId)
|
||||
{
|
||||
_base.setTile(x, y, tile);
|
||||
// update the model as well
|
||||
@@ -132,7 +132,7 @@ public class EditableMisoSceneImpl
|
||||
protected int[] _objectTileIds;
|
||||
|
||||
/** The default tile with which to fill the base layer. */
|
||||
protected MisoTile _defaultBaseTile;
|
||||
protected BaseTile _defaultBaseTile;
|
||||
|
||||
/** The fully qualified tile id of the default base tile. */
|
||||
protected int _defaultBaseTileId;
|
||||
|
||||
Reference in New Issue
Block a user