public class TiledArea extends Object
Modifier and Type | Class and Description |
---|---|
static class |
TiledArea.Tile
A tile.
|
Constructor and Description |
---|
TiledArea(Area area,
double length)
Create a tiled area
|
TiledArea(Area area,
double xLength,
double yLength)
Create a tiled area
|
Modifier and Type | Method and Description |
---|---|
boolean |
areTilesSquare()
Whether or not the tile are squares.
|
List<TiledArea.Tile> |
findOccupiedTiles(Shape shape)
Get the list of tiles that are occupied by the given Shape.
|
Area |
getArea()
Get the area controlled by this tiled area
|
int |
getNumberOfTiles()
Get the total number of tiles
|
TiledArea.Tile |
getTile(int x,
int y)
Get the tile at the (x,y) location in the grid
|
TiledArea.Tile |
getTileById(int id)
Get a tile according to its id.
|
double |
getXLength()
Get the length of a tile in the x-direction
|
int |
getXNum()
Get the number of tiles in the x-direction
|
double |
getYLength()
Get the length of a tile in the y-direction
|
int |
getYNum()
Get the number of tiles in the y-direction
|
public TiledArea(Area area, double length)
area
- the arealength
- the length of a tile in both directionspublic TiledArea(Area area, double xLength, double yLength)
area
- the areaxLength
- the length of a tile in the x-directionyLength
- the length of a tile in the y-directionpublic Area getArea()
public int getXNum()
public int getYNum()
public double getXLength()
public double getYLength()
public TiledArea.Tile getTile(int x, int y)
x
- the x-coordinate of the tiley
- the y-coordinate of the tilepublic int getNumberOfTiles()
public boolean areTilesSquare()
public TiledArea.Tile getTileById(int id)
id
- the id of the tilepublic List<TiledArea.Tile> findOccupiedTiles(Shape shape)
shape
- the Shape for which to find occupied tilesCopyright © 2013. All rights reserved.