Class CollisionDumper


  • public class CollisionDumper
    extends java.lang.Object
    Handles 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
      CollisionMap collect()
      Collects collision data from the game within default distance (104 tiles).
      CollisionMap collect​(int distance)
      Collects collision data from the game within specified distance.
      boolean collectAndSave​(java.lang.String filePath)
      Convenience method to collect from game and save to file with default distance.
      boolean collectAndSave​(java.lang.String filePath, int distance)
      Convenience method to collect from game and save to file.
      CollisionMap loadFromFile​(java.lang.String filePath)
      Loads collision map from a JSON file.
      boolean saveToFile​(CollisionMap collisionMap, java.lang.String filePath)
      Saves collision map to a JSON file.
      java.awt.Point worldToSim​(net.runelite.api.coords.WorldPoint point, int minX, int minY, int width, int height)
      Converts world coordinates to simulation coordinates.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • CollisionDumper

        public CollisionDumper()
    • 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 convert
        minX - The minimum x value of all points in the currently loaded scene
        minY - The minimum y value of all points in the currently loaded scene
        width - The width of the scene
        height - 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 save
        filePath - 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 file
        distance - 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