|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object aim4.util.TiledArea
public class TiledArea
A tiled area - a subdivision of an area into a grid of small rectangles.
Nested Class Summary | |
---|---|
static class |
TiledArea.Tile
A tile. |
Constructor Summary | |
---|---|
TiledArea(Area area,
double length)
Create a tiled area |
|
TiledArea(Area area,
double xLength,
double yLength)
Create a tiled area |
Method Summary | |
---|---|
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 |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
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-directionMethod Detail |
---|
public 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 tile
public int getNumberOfTiles()
public boolean areTilesSquare()
public TiledArea.Tile getTileById(int id)
id
- the id of the tile
public List<TiledArea.Tile> findOccupiedTiles(Shape shape)
shape
- the Shape for which to find occupied tiles
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |