Interface Locatable

All Superinterfaces:
Validatable
All Known Subinterfaces:
Actor, GameEntity, GraphicsObject, 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

    Modifier and Type
    Method
    Description
    default boolean
    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
    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
    Gets the distance to this entity.
    default double
    Gets the distance between this and the given other entity.
    default Area
    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.
    Gets the tile that this entity is located on in the world.
    default Point
    Gets the location on the minimap of this entity.
    int
    Gets the z-coordinate, also known as the floor or level.
    Gets the scene offset for this entity.
    int
    Gets the x-coordinate.
    int
    Gets the y-coordinate.
    default boolean
    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.
    default int
    Gets the tile distance to this entity.
    default int
    Gets the tile distance between this and the given other entity.

    Methods inherited from interface com.epicbot.api.shared.entity.details.Validatable

    isValid
  • Method Details

    • 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()
      Gets the area occupied by this entity.
      Returns:
      Area
    • 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
    • tileDistanceTo

      default int tileDistanceTo(APIContext ctx)
      Gets the tile distance to this entity.
      Parameters:
      ctx - APIContext
      Returns:
      double
    • tileDistanceTo

      default int tileDistanceTo(APIContext ctx, Locatable other)
      Gets the tile 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 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-coordinate
      y - 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-coordinate
      y - offset added to y-coordinate
      plane - 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-coordinate
      y - 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 difference
      right - maximum positive x difference
      down - maximum negative y difference
      up - 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-coordinate
      y - random y-offset added to y-coordinate
      plane - 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