Interface IMapOrientation


public interface IMapOrientation
  • Method Details

    • getName

      String getName()
      Gets the name of this IMapOrientation.
      Returns:
      The name of this orientation
    • getSize

      Dimension getSize(IMap map)
      Determines the size required for all tiles within the given map to be drawn into an image. Tiles larger than the map's tile size may not fit within this size.
      Parameters:
      map - The IMap to measure
      Returns:
      The required image size
    • getLocation

      Point getLocation(int x, int y, IMap map)
      Determines the rendered location of a tile within the given IMap, 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 by getShape.
      Parameters:
      x - The saved X coordinate of the tile
      y - The saved Y coordinate of the tile
      map - The IMap that the tile is in
      Returns:
      The location of a tile for the given map and coordinates
    • getLocation

      Point getLocation(Point tile, IMap map)
      Determines the rendered location of a tile within the given IMap, 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 by getShape.
      Parameters:
      tile - The saved location of the tile
      map - The IMap that the tile is in
      Returns:
      The location of a tile for the given map and coordinates
    • getShape

      Shape getShape(int x, int y, IMap map)
      Creates a Shape for 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 tile
      y - The Y coordinate of the tile
      map - The IMap that the tile is in
      Returns:
      The shape of the tile
    • getShape

      Shape getShape(Point tile, IMap map)
      Creates a Shape for 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 tile
      map - The IMap that the tile is in
      Returns:
      The shape of the tile
    • getBounds

      Rectangle2D getBounds(int x, int y, IMap map)
      Determines the bounding box for the tile at the given coordinates. A call to this method is equivalent to calling orientation.getShape(x, y, map).getBounds2D().
      Parameters:
      x - The X coordinate of the tile
      y - The Y coordinate of the tile
      map - The IMap that the tile is in
      Returns:
      The bounding box of the tile
    • getBounds

      Rectangle2D getBounds(Point tile, IMap map)
      Determines the bounding box for the tile at the given coordinates. A call to this method is equivalent to calling orientation.getShape(tile, map).getBounds2D().
      Parameters:
      tile - The location of the tile
      map - The IMap that the tile is in
      Returns:
      The bounding box of the tile
    • getEnclosingTileShape

      Shape getEnclosingTileShape(double x, double y, IMap map)
      Returns the shape of the tile containing the given coordinates. A call to this method is equivalent to calling orientation.getShape(orientation.getTile(x, y, map), map).
      Parameters:
      x - The X coordinate to contain
      y - The Y coordinate to contain
      map - The IMap containing the tile
      Returns:
      The shape of the tile containing the given point
    • getEnclosingTileShape

      Shape getEnclosingTileShape(Point2D location, IMap map)
      Returns the shape of the tile containing the given coordinates. A call to this method is equivalent to calling orientation.getShape(orientation.getTile(location, map), map).
      Parameters:
      location - The point to contain
      map - The IMap containing the tile
      Returns:
      The shape of the tile containing the given point
    • getEnclosingTileBounds

      Rectangle2D getEnclosingTileBounds(double x, double y, IMap map)
      Returns the bounding box of the tile containing the given coordinates. A call to this method is equivalent to calling orientation.getShape(orientation.getTile(x, y, map), map).getBounds2D().
      Parameters:
      x - The X coordinate to contain
      y - The Y coordinate to contain
      map - The IMap containing the tile
      Returns:
      The bounding box of the tile containing the given point
    • getEnclosingTileBounds

      Rectangle2D getEnclosingTileBounds(Point2D location, IMap map)
      Returns the bounding box of the tile containing the given coordinates. A call to this method is equivalent to calling orientation.getShape(orientation.getTile(location, map), map).getBounds2D().
      Parameters:
      location - The point to contain
      map - The IMap containing the tile
      Returns:
      The bounding box of the tile containing the given point
    • getTile

      Point getTile(double x, double y, IMap map)
      Determines the coordinates of the tile containing the given point, as determined by getShape(int, int, IMap).
      Parameters:
      x - The X coordinate to contain
      y - The Y coordinate to contain
      map - The IMap containing the tile
      Returns:
      The tile coordinates of the tile containing the point.
      Throws:
      ArithmeticException - if the tiles are packed too tightly to resolve
    • getTile

      Point getTile(Point2D location, IMap map)
      Determines the coordinates of the tile containing the given point, as determined by getShape(int, int, IMap).
      Parameters:
      location - The point to contain
      map - The IMap containing the tile
      Returns:
      The tile coordinates of the tile containing the point.
      Throws:
      ArithmeticException - if the tiles are packed too tightly to resolve