Package com.valhalla.sdk.api.entities
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 TypeMethodDescriptiondefault booleancanReach()Tests local collision reachability from the current player tile.default booleanTests local collision reachability from an explicit start tile.default intdistance()Measures direct distance from the local player.default intdistanceTo(Tile tile) Measures Chebyshev tile distance without pathfinding.default intgetGridX()Returns the scene-local X coordinate.default intgetGridY()Returns the scene-local Y coordinate.default intgetPlane()Returns the world plane.default intReturns the map-region identifier.getTile()Returns the represented world location.default intgetX()Returns the world X coordinate.default intgetY()Returns the world Y coordinate.default intgetZ()Returns the world plane using Z terminology.default booleanTests membership in an area.default booleanisWithinDistance(Tile tile, int distance) Tests same-plane proximity.default intwalkingDistance(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
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:
truewhen the live collision map contains a route
-
canReach
Tests local collision reachability from an explicit start tile.- Parameters:
start- route origin- Returns:
truewhen the live collision map contains a route
-
walkingDistance
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
Tests same-plane proximity.- Parameters:
tile- comparison tiledistance- inclusive Chebyshev radius- Returns:
truewhen both values share a plane and fall within the radius
-
isInArea
Tests membership in an area.- Parameters:
area- area to test- Returns:
truewhen the area's plane and polygon contain this tile
-