public class TileGame extends Object implements Tile
Constructor and Description |
---|
TileGame(Integer sheet,
int number,
double x,
double y,
int width,
int height)
Create a tile.
|
Modifier and Type | Method and Description |
---|---|
void |
addFeature(TileFeature feature)
Add a map feature for external processing.
|
boolean |
equals(Object obj) |
<C extends TileFeature> |
getFeature(Class<C> feature)
Get a feature instance from its type.
|
Iterable<? extends TileFeature> |
getFeatures()
Get the supported features.
|
int |
getHeight() |
int |
getInTileHeight()
Get the height in tile.
|
int |
getInTileWidth()
Get the width in tile.
|
int |
getInTileX()
Get horizontal tile location.
|
int |
getInTileY()
Get vertical tile location.
|
int |
getNumber()
Get tile index number.
|
Integer |
getSheet()
Get sheet number.
|
int |
getWidth() |
double |
getX() |
double |
getY() |
<C extends TileFeature> |
hasFeature(Class<C> feature)
Check a feature existence from its type.
|
int |
hashCode() |
public TileGame(Integer sheet, int number, double x, double y, int width, int height)
sheet
- The sheet number (must be positive or equal to 0).number
- The tile number on sheet (must be positive or equal to 0).x
- The horizontal location.y
- The vertical location.width
- The tile width (must be strictly positive).height
- The tile height (must be strictly positive).LionEngineException
- If invalid arguments.public void addFeature(TileFeature feature)
Featurable
addFeature
in interface Featurable<TileFeature>
feature
- The feature to add.public int getNumber()
Tile
public double getX()
getX
in interface Localizable
public double getY()
getY
in interface Localizable
public int getInTileX()
Tiled
getInTileX
in interface Tiled
public int getInTileY()
Tiled
getInTileY
in interface Tiled
public int getInTileWidth()
Tiled
getInTileWidth
in interface Tiled
public int getInTileHeight()
Tiled
getInTileHeight
in interface Tiled
public <C extends TileFeature> C getFeature(Class<C> feature)
Featurable
getFeature
in interface Featurable<TileFeature>
C
- The custom feature type.feature
- The feature type.public Iterable<? extends TileFeature> getFeatures()
Featurable
getFeatures
in interface Featurable<TileFeature>
public <C extends TileFeature> boolean hasFeature(Class<C> feature)
Featurable
hasFeature
in interface Featurable<TileFeature>
C
- The custom feature type.feature
- The feature type.true
if feature exists, false
else.Copyright © 2016 Byron 3D Games Studio. All rights reserved.