Interface IMapOrientation
public interface IMapOrientation
-
Method Summary
Modifier and TypeMethodDescriptionDetermines the bounding box for the tile at the given coordinates.Determines the bounding box for the tile at the given coordinates.getEnclosingTileBounds(double x, double y, IMap map) Returns the bounding box of the tile containing the given coordinates.getEnclosingTileBounds(Point2D location, IMap map) Returns the bounding box of the tile containing the given coordinates.getEnclosingTileShape(double x, double y, IMap map) Returns the shape of the tile containing the given coordinates.getEnclosingTileShape(Point2D location, IMap map) Returns the shape of the tile containing the given coordinates.getLocation(int x, int y, IMap map) Determines the rendered location of a tile within the givenIMap, given the saved coordinates of the tile.getLocation(Point tile, IMap map) Determines the rendered location of a tile within the givenIMap, given the saved coordinates of the tile.getName()Gets the name of thisIMapOrientation.Creates aShapefor the tile at the given coordinates.Creates aShapefor the tile at the given coordinates.Determines the size required for all tiles within the given map to be drawn into an image.Determines the coordinates of the tile containing the given point, as determined bygetShape(int, int, IMap).Determines the coordinates of the tile containing the given point, as determined bygetShape(int, int, IMap).
-
Method Details
-
getName
-
getSize
-
getLocation
Determines the rendered location of a tile within the givenIMap, given the saved coordinates of the tile. The coordinates of the point returned are those of the bottom-left corner of the tile's image relative to the top-left corner of the rectangle in which tiles in the given map are drawn. The point returned by this method will not necessarily be contained inside the shape returned bygetShape.- Parameters:
x- The saved X coordinate of the tiley- The saved Y coordinate of the tilemap- TheIMapthat the tile is in- Returns:
- The location of a tile for the given map and coordinates
-
getLocation
Determines the rendered location of a tile within the givenIMap, given the saved coordinates of the tile. The coordinates of the point returned are those of the bottom-left corner of the tile's image relative to the top-left corner of the rectangle in which tiles in the given map are drawn. The point returned by this method will not necessarily be contained inside the shape returned bygetShape.- Parameters:
tile- The saved location of the tilemap- TheIMapthat the tile is in- Returns:
- The location of a tile for the given map and coordinates
-
getShape
Creates aShapefor the tile at the given coordinates. The shapes returned by this method should reflect the intended shape of a tile in this orientation, and in general should not overlap.- Parameters:
x- The X coordinate of the tiley- The Y coordinate of the tilemap- TheIMapthat the tile is in- Returns:
- The shape of the tile
-
getShape
Creates aShapefor the tile at the given coordinates. The shapes returned by this method should reflect the intended shape of a tile in this orientation, and in general should not overlap.- Parameters:
tile- The location of the tilemap- TheIMapthat the tile is in- Returns:
- The shape of the tile
-
getBounds
Determines the bounding box for the tile at the given coordinates. A call to this method is equivalent to callingorientation.getShape(x, y, map).getBounds2D().- Parameters:
x- The X coordinate of the tiley- The Y coordinate of the tilemap- TheIMapthat the tile is in- Returns:
- The bounding box of the tile
-
getBounds
Determines the bounding box for the tile at the given coordinates. A call to this method is equivalent to callingorientation.getShape(tile, map).getBounds2D().- Parameters:
tile- The location of the tilemap- TheIMapthat the tile is in- Returns:
- The bounding box of the tile
-
getEnclosingTileShape
Returns the shape of the tile containing the given coordinates. A call to this method is equivalent to callingorientation.getShape(orientation.getTile(x, y, map), map).- Parameters:
x- The X coordinate to containy- The Y coordinate to containmap- TheIMapcontaining the tile- Returns:
- The shape of the tile containing the given point
-
getEnclosingTileShape
Returns the shape of the tile containing the given coordinates. A call to this method is equivalent to callingorientation.getShape(orientation.getTile(location, map), map).- Parameters:
location- The point to containmap- TheIMapcontaining the tile- Returns:
- The shape of the tile containing the given point
-
getEnclosingTileBounds
Returns the bounding box of the tile containing the given coordinates. A call to this method is equivalent to callingorientation.getShape(orientation.getTile(x, y, map), map).getBounds2D().- Parameters:
x- The X coordinate to containy- The Y coordinate to containmap- TheIMapcontaining the tile- Returns:
- The bounding box of the tile containing the given point
-
getEnclosingTileBounds
Returns the bounding box of the tile containing the given coordinates. A call to this method is equivalent to callingorientation.getShape(orientation.getTile(location, map), map).getBounds2D().- Parameters:
location- The point to containmap- TheIMapcontaining the tile- Returns:
- The bounding box of the tile containing the given point
-
getTile
Determines the coordinates of the tile containing the given point, as determined bygetShape(int, int, IMap).- Parameters:
x- The X coordinate to containy- The Y coordinate to containmap- TheIMapcontaining the tile- Returns:
- The tile coordinates of the tile containing the point.
- Throws:
ArithmeticException- if the tiles are packed too tightly to resolve
-
getTile
Determines the coordinates of the tile containing the given point, as determined bygetShape(int, int, IMap).- Parameters:
location- The point to containmap- TheIMapcontaining the tile- Returns:
- The tile coordinates of the tile containing the point.
- Throws:
ArithmeticException- if the tiles are packed too tightly to resolve
-