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,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();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user