Package com.kraken.api.sim
Class CollisionDumper
- java.lang.Object
-
- com.kraken.api.sim.CollisionDumper
-
public class CollisionDumper extends java.lang.ObjectHandles collision data dumping, loading, and conversion between different formats. Supports both in-game data collection and file-based operations.
-
-
Constructor Summary
Constructors Constructor Description CollisionDumper()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description CollisionMapcollect()Collects collision data from the game within default distance (104 tiles).CollisionMapcollect(int distance)Collects collision data from the game within specified distance.booleancollectAndSave(java.lang.String filePath)Convenience method to collect from game and save to file with default distance.booleancollectAndSave(java.lang.String filePath, int distance)Convenience method to collect from game and save to file.CollisionMaploadFromFile(java.lang.String filePath)Loads collision map from a JSON file.booleansaveToFile(CollisionMap collisionMap, java.lang.String filePath)Saves collision map to a JSON file.java.awt.PointworldToSim(net.runelite.api.coords.WorldPoint point, int minX, int minY, int width, int height)Converts world coordinates to simulation coordinates.
-
-
-
Method Detail
-
collect
public CollisionMap collect()
Collects collision data from the game within default distance (104 tiles).- Returns:
- CollisionMap containing the collision data
-
collect
public CollisionMap collect(int distance)
Collects collision data from the game within specified distance. Builds the collision map directly without intermediate storage.- Parameters:
distance- Maximum distance from player to collect data- Returns:
- CollisionMap containing the collision data
-
worldToSim
public java.awt.Point worldToSim(net.runelite.api.coords.WorldPoint point, int minX, int minY, int width, int height)Converts world coordinates to simulation coordinates.- Parameters:
point- The world point to convertminX- The minimum x value of all points in the currently loaded sceneminY- The minimum y value of all points in the currently loaded scenewidth- The width of the sceneheight- The height of the scene- Returns:
- Array coordinates as [x, y], or null if out of bounds
-
saveToFile
public boolean saveToFile(CollisionMap collisionMap, java.lang.String filePath)
Saves collision map to a JSON file.- Parameters:
collisionMap- The collision map to savefilePath- Path to the output file- Returns:
- true if successful, false otherwise
-
loadFromFile
public CollisionMap loadFromFile(java.lang.String filePath)
Loads collision map from a JSON file.- Parameters:
filePath- Path to the input file- Returns:
- CollisionMap, or empty map if failed
-
collectAndSave
public boolean collectAndSave(java.lang.String filePath, int distance)Convenience method to collect from game and save to file.- Parameters:
filePath- Path to the output filedistance- Maximum distance from player to collect data- Returns:
- true if successful, false otherwise
-
collectAndSave
public boolean collectAndSave(java.lang.String filePath)
Convenience method to collect from game and save to file with default distance.- Parameters:
filePath- Path to the output file- Returns:
- true if successful, false otherwise
-
-