public interface Locatable extends Validatable
Modifier and Type | Method and Description |
---|---|
default boolean |
canReach(APIContext ctx)
Checks whether or not we can reach this entity.
|
default boolean |
canReach(APIContext ctx,
int radius)
Checks if a tile within the squared radius can be reached.
|
default boolean |
canReach(APIContext ctx,
Locatable origin)
Checks whether or not this entity can be reached from the given entity.
|
default Tile |
derive(int x,
int y)
Derives a new tile from the current location.
|
default Tile |
derive(int x,
int y,
int plane)
Derives a new tile from the current location.
|
default double |
distanceTo(APIContext ctx)
Gets the distance to this entity.
|
default double |
distanceTo(APIContext ctx,
Locatable other)
Gets the distance between this and the given other entity.
|
default Area |
getArea()
Gets the area occupied by this entity.
|
default Area |
getArea(int radius)
Gets a rectangular area from the center of this entity with the given radius.
|
Tile |
getLocation()
Gets the tile that this entity is located on in the world.
|
default java.awt.Point |
getMapPoint(APIContext ctx)
Gets the location on the minimap of this entity.
|
int |
getPlane()
Gets the z-coordinate, also known as the floor or level.
|
SceneOffset |
getSceneOffset()
Gets the scene offset for this entity.
|
int |
getX()
Gets the x-coordinate.
|
int |
getY()
Gets the y-coordinate.
|
default boolean |
isOnMap(APIContext ctx)
Gets if this entity is visible on the (mini)map.
|
default Tile |
randomize(int x,
int y)
Derives a random new tile from the current location.
|
default Tile |
randomize(int x,
int y,
int plane)
Derives a random new tile from the current location.
|
default Tile |
randomize(int left,
int right,
int down,
int up)
Derives a random new tile from the current location.
|
isValid
int getX()
int getY()
int getPlane()
Tile getLocation()
Tile
SceneOffset getSceneOffset()
SceneOffset
default Area getArea(int radius)
radius
- the radiusArea
default double distanceTo(APIContext ctx)
ctx
- APIContext
default double distanceTo(APIContext ctx, Locatable other)
ctx
- APIContext
other
- the entity to calculate the distance todefault boolean isOnMap(APIContext ctx)
ctx
- APIContext
default java.awt.Point getMapPoint(APIContext ctx)
ctx
- APIContext
Point
default Tile derive(int x, int y)
x
- offset added to x-coordinatey
- offset added to y-coordinatedefault Tile derive(int x, int y, int plane)
x
- offset added to x-coordinatey
- offset added to y-coordinateplane
- offset added to z-coordinatedefault Tile randomize(int x, int y)
x
- random x-offset added to x-coordinatey
- random y-offset added to y-coordinatedefault Tile randomize(int left, int right, int down, int up)
left
- maximum negative x differenceright
- maximum positive x differencedown
- maximum negative y differenceup
- maximum positive y differencedefault Tile randomize(int x, int y, int plane)
x
- random x-offset added to x-coordinatey
- random y-offset added to y-coordinateplane
- random plane added to z-coordinatedefault boolean canReach(APIContext ctx)
ctx
- APIContext
default boolean canReach(APIContext ctx, Locatable origin)
ctx
- APIContext
origin
- the origin to start fromdefault boolean canReach(APIContext ctx, int radius)
ctx
- APIContext
radius
- the radius from the center