Interface Locatable
-
- All Superinterfaces:
Validatable
- All Known Subinterfaces:
Actor
,GameEntity
,GroundItem
,HintArrow
,LocatableEntity
,NPC
,Player
,Projectile
,SceneObject
- All Known Implementing Classes:
Tile
public interface Locatable extends Validatable
An entity that can be located in the world.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method 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.-
Methods inherited from interface com.epicbot.api.shared.entity.details.Validatable
isValid
-
-
-
-
Method Detail
-
getX
int getX()
Gets the x-coordinate.- Returns:
- int
-
getY
int getY()
Gets the y-coordinate.- Returns:
- int
-
getPlane
int getPlane()
Gets the z-coordinate, also known as the floor or level.- Returns:
- int
-
getLocation
Tile getLocation()
Gets the tile that this entity is located on in the world.- Returns:
Tile
-
getSceneOffset
SceneOffset getSceneOffset()
Gets the scene offset for this entity.- Returns:
SceneOffset
-
getArea
default Area getArea(int radius)
Gets a rectangular area from the center of this entity with the given radius.- Parameters:
radius
- the radius- Returns:
Area
-
distanceTo
default double distanceTo(APIContext ctx)
Gets the distance to this entity.- Parameters:
ctx
-APIContext
- Returns:
- double
-
distanceTo
default double distanceTo(APIContext ctx, Locatable other)
Gets the distance between this and the given other entity.- Parameters:
ctx
-APIContext
other
- the entity to calculate the distance to- Returns:
- double
-
isOnMap
default boolean isOnMap(APIContext ctx)
Gets if this entity is visible on the (mini)map.- Parameters:
ctx
-APIContext
- Returns:
- true if visible, false otherwise
-
getMapPoint
default java.awt.Point getMapPoint(APIContext ctx)
Gets the location on the minimap of this entity.- Parameters:
ctx
-APIContext
- Returns:
Point
-
derive
default Tile derive(int x, int y)
Derives a new tile from the current location.- Parameters:
x
- offset added to x-coordinatey
- offset added to y-coordinate- Returns:
- the new derived tile
-
derive
default Tile derive(int x, int y, int plane)
Derives a new tile from the current location.- Parameters:
x
- offset added to x-coordinatey
- offset added to y-coordinateplane
- offset added to z-coordinate- Returns:
- the new derived tile
-
randomize
default Tile randomize(int x, int y)
Derives a random new tile from the current location. For example passing in 3 will generate a number between -3 and 3.- Parameters:
x
- random x-offset added to x-coordinatey
- random y-offset added to y-coordinate- Returns:
- the new tile
-
randomize
default Tile randomize(int left, int right, int down, int up)
Derives a random new tile from the current location.- Parameters:
left
- maximum negative x differenceright
- maximum positive x differencedown
- maximum negative y differenceup
- maximum positive y difference- Returns:
- the new tile
-
randomize
default Tile randomize(int x, int y, int plane)
Derives a random new tile from the current location. Passing in 3 will generate a number between -3 and 3, plane is always positive (between 0 and 3).- Parameters:
x
- random x-offset added to x-coordinatey
- random y-offset added to y-coordinateplane
- random plane added to z-coordinate- Returns:
- the new tile
-
canReach
default boolean canReach(APIContext ctx)
Checks whether or not we can reach this entity.- Parameters:
ctx
-APIContext
- Returns:
- true if this entity can be reached, otherwise false
-
canReach
default boolean canReach(APIContext ctx, Locatable origin)
Checks whether or not this entity can be reached from the given entity.- Parameters:
ctx
-APIContext
origin
- the origin to start from- Returns:
- true if this entity can be reached, otherwise false
-
canReach
default boolean canReach(APIContext ctx, int radius)
Checks if a tile within the squared radius can be reached. For example with a radius of 1 the northern, eastern, southern and western tile will be checked if they are reachable.- Parameters:
ctx
-APIContext
radius
- the radius from the center- Returns:
- true if this entity can be reached, otherwise false
-
-