public class TilingScheme.Tile
extends java.lang.Object
Constructor and Description |
---|
Tile(TilingScheme.TilePosition pos,
java.lang.Object data)
Creates a new tile with the specified parameters.
|
Modifier and Type | Method and Description |
---|---|
boolean |
contains(int row,
int col)
Determines if a global coordinate is contained in this tile.
|
java.lang.Object |
getData()
Gets the tile data.
|
int[] |
getDimensions()
Gets the tile dimensions.
|
boolean |
getDirty()
Gets the tile dirty flag.
|
int |
getIndex(int row,
int col)
Gets an index into the tile data based on a global data
coordinate.
|
TilingScheme.TilePosition |
getPosition()
Gets the tile position.
|
java.awt.Rectangle |
getRectangle()
Gets the tile rectangle.
|
TilingScheme |
getScheme()
Gets the tiling scheme for this tile.
|
boolean |
hasPosition(TilingScheme.TilePosition pos)
Compares the tile position to this tile for equality.
|
void |
setData(java.lang.Object data)
Sets the tile data.
|
void |
setDirty(boolean flag)
Sets the tile dirty flag.
|
java.lang.String |
toString() |
public Tile(TilingScheme.TilePosition pos, java.lang.Object data)
pos
- the tile position in the grid.data
- the tile data.public void setData(java.lang.Object data)
public java.lang.Object getData()
public int[] getDimensions()
public TilingScheme.TilePosition getPosition()
public boolean getDirty()
public void setDirty(boolean flag)
public java.lang.String toString()
toString
in class java.lang.Object
public boolean contains(int row, int col)
row
- the global row coordinate.col
- the global column coordinate.public int getIndex(int row, int col)
row
- the global row coordinate.col
- the global column coordinate.public java.awt.Rectangle getRectangle()
public boolean hasPosition(TilingScheme.TilePosition pos)
pos
- the tile position for comparison.public TilingScheme getScheme()