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