public abstract class AbstractTiledTerrainData extends AbstractTerrainData implements TiledTerrainData
This class provides a lot of the common functionality that all implementations will require. Good to save you typing.
| Modifier and Type | Field and Description |
|---|---|
protected int |
gridPointsPerTile
The number of grid points per tile.
|
protected TextureTileGenerator |
tileGenerator
Reference to the currently set texture tile generator
|
colorAvailable, gridStepX, gridStepY, textureAvailableFREEFORM_DATA, STATIC_DATA, TILED_DATA| Modifier | Constructor and Description |
|---|---|
protected |
AbstractTiledTerrainData()
Create a new instance.of this data class with all flags set to false.
|
| Modifier and Type | Method and Description |
|---|---|
protected int |
convertGridToTileCoord(int grid)
Convenience method to convert the grid coordinate to the tile that it
belongs in.
|
protected int |
convertTileToGridCoord(int tile)
Convenience method to convert the tile coordinate to a grid coordinate
|
BufferedImage |
getTexture(int tileX,
int tileY)
Fetch the texture or part of a texture that can be applied to the
sub-region of the overall object.
|
int |
getTileSize()
Get the number of grid points along one side of a single tile.
|
void |
setTextureTileGenerator(TextureTileGenerator gen)
Set the texture tile geneattor instance to the new value.
|
getGridXStep, getGridYStep, getSourceDataType, hasColor, hasTextureclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitgetTilesAvailableBounds, setActiveBoundsgetCoordinate, getCoordinate, getCoordinateWithColor, getCoordinateWithTexture, getGridXStep, getGridYStep, getHeightFromGrid, getSourceDataType, hasColor, hasTexturegetHeightprotected TextureTileGenerator tileGenerator
protected int gridPointsPerTile
protected AbstractTiledTerrainData()
public int getTileSize()
getTileSize in interface TiledTerrainDatapublic BufferedImage getTexture(int tileX, int tileY)
getTexture in interface TiledTerrainDatatileX - the x coordinate of the tile number for the texturetileY - the y coordinate of the tile number for the texturepublic void setTextureTileGenerator(TextureTileGenerator gen)
gen - The new generator instance to useprotected int convertTileToGridCoord(int tile)
tile - The tile coordinateprotected int convertGridToTileCoord(int grid)
grid - The grid coordinate
Copyright © 2001 - 2015 j3d.org