Interface Locatable

All Known Subinterfaces:
GameObject, LocalPlayer
All Known Implementing Classes:
Area, GroundItem, Npc, Player, SceneObject, Tile

public interface Locatable
A world-space value or snapshot that occupies a tile.
  • Method Summary

    Modifier and Type
    Method
    Description
    default boolean
    Tests local collision reachability from the current player tile.
    default boolean
    canReach(Tile start)
    Tests local collision reachability from an explicit start tile.
    default int
    Measures direct distance from the local player.
    default int
    Measures Chebyshev tile distance without pathfinding.
    default int
    Returns the scene-local X coordinate.
    default int
    Returns the scene-local Y coordinate.
    default int
    Returns the world plane.
    default int
    Returns the map-region identifier.
    Returns the represented world location.
    default int
    Returns the world X coordinate.
    default int
    Returns the world Y coordinate.
    default int
    Returns the world plane using Z terminology.
    default boolean
    isInArea(Area area)
    Tests membership in an area.
    default boolean
    isWithinDistance(Tile tile, int distance)
    Tests same-plane proximity.
    default int
    walkingDistance(Tile destination)
    Returns exact local collision distance when available, otherwise a conservative estimate.
  • Method Details

    • getTile

      Tile getTile()
      Returns the represented world location.
      Returns:
      immutable world tile represented by this value
    • distanceTo

      default int distanceTo(Tile tile)
      Measures Chebyshev tile distance without pathfinding.
      Parameters:
      tile - destination tile
      Returns:
      maximum absolute X/Y difference
    • distance

      default int distance()
      Measures direct distance from the local player.
      Returns:
      Chebyshev distance from the local player
    • getX

      default int getX()
      Returns the world X coordinate.
      Returns:
      world X coordinate
    • getY

      default int getY()
      Returns the world Y coordinate.
      Returns:
      world Y coordinate
    • getPlane

      default int getPlane()
      Returns the world plane.
      Returns:
      world plane
    • getZ

      default int getZ()
      Returns the world plane using Z terminology.
      Returns:
      world plane; alias for getPlane()
    • getGridX

      default int getGridX()
      Returns the scene-local X coordinate.
      Returns:
      scene-local X coordinate relative to the current scene base
    • getGridY

      default int getGridY()
      Returns the scene-local Y coordinate.
      Returns:
      scene-local Y coordinate relative to the current scene base
    • getRegionId

      default int getRegionId()
      Returns the map-region identifier.
      Returns:
      packed 64-by-64 map-region identifier
    • canReach

      default boolean canReach()
      Tests local collision reachability from the current player tile.
      Returns:
      true when the live collision map contains a route
    • canReach

      default boolean canReach(Tile start)
      Tests local collision reachability from an explicit start tile.
      Parameters:
      start - route origin
      Returns:
      true when the live collision map contains a route
    • walkingDistance

      default int walkingDistance(Tile destination)
      Returns exact local collision distance when available, otherwise a conservative estimate.
      Parameters:
      destination - destination tile
      Returns:
      path length, or three times Chebyshev distance when no exact route is available
    • isWithinDistance

      default boolean isWithinDistance(Tile tile, int distance)
      Tests same-plane proximity.
      Parameters:
      tile - comparison tile
      distance - inclusive Chebyshev radius
      Returns:
      true when both values share a plane and fall within the radius
    • isInArea

      default boolean isInArea(Area area)
      Tests membership in an area.
      Parameters:
      area - area to test
      Returns:
      true when the area's plane and polygon contain this tile