Package com.valhalla.sdk.api.methods
Class Map
java.lang.Object
com.valhalla.sdk.api.methods.Map
Local map and collision helpers modeled after the common DreamBot surface.
-
Method Summary
Modifier and TypeMethodDescriptionstatic booleanTests local collision reachability from the player.static booleanTests local collision reachability between two tiles.static booleancanReach(CollisionMap map, Tile start, Tile destination) Tests reachability against an explicit collision snapshot.static intexactDistance(Tile destination) Computes collision-path distance from the player.static intexactDistance(Tile start, Tile destination) Computes collision-path distance between two tiles.static intexactDistance(CollisionMap map, Tile start, Tile destination) Computes distance against an explicit collision snapshot.static intReads normalized collision flags for a loaded tile.getWalkable(Tile tile) Finds the nearest walkable tile within eight tiles.getWalkable(CollisionMap map, Tile tile, int radius) Finds the nearest walkable tile within a bounded square.static booleanTests whether a tile is loaded by the local scene.
-
Method Details
-
isLocal
Tests whether a tile is loaded by the local scene.- Parameters:
tile- tile to test- Returns:
truewhen the tile is loaded
-
canReach
Tests local collision reachability from the player.- Parameters:
destination- target tile- Returns:
truewhen a collision-valid path exists
-
canReach
Tests local collision reachability between two tiles.- Parameters:
start- path origindestination- path target- Returns:
truewhen a collision-valid path exists
-
canReach
Tests reachability against an explicit collision snapshot.- Parameters:
map- collision snapshotstart- path origindestination- path target- Returns:
truewhen a collision-valid path exists
-
exactDistance
Computes collision-path distance from the player.- Parameters:
destination- path target- Returns:
- number of transitions, or
-1when unreachable
-
exactDistance
Computes collision-path distance between two tiles.- Parameters:
start- path origindestination- path target- Returns:
- number of transitions, or
-1when unreachable
-
exactDistance
Computes distance against an explicit collision snapshot.- Parameters:
map- collision snapshotstart- path origindestination- path target- Returns:
- number of transitions, or
-1when unreachable
-
getFlag
Reads normalized collision flags for a loaded tile.- Parameters:
tile- tile to inspect- Returns:
- normalized collision bit mask
-
getWalkable
Finds the nearest walkable tile within eight tiles.- Parameters:
tile- preferred tile- Returns:
- the preferred tile or its nearest walkable neighbor
-
getWalkable
Finds the nearest walkable tile within a bounded square.- Parameters:
map- collision snapshottile- preferred tileradius- non-negative search radius- Returns:
- the preferred tile or its nearest walkable neighbor
-