Class AreaService


  • public class AreaService
    extends java.lang.Object
    • Constructor Summary

      Constructors 
      Constructor Description
      AreaService()  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      GameArea createAreaFromRadius​(net.runelite.api.coords.WorldPoint center, int radius)
      Creates a square area around a center point.
      GameArea createFromPoints​(java.util.Collection<net.runelite.api.coords.WorldPoint> points)
      Creates an area from a raw collection of points.
      GameArea createPolygonArea​(java.util.List<net.runelite.api.coords.WorldPoint> vertices)
      Creates a complex shape from a list of vertices.
      GameArea createPolygonArea​(net.runelite.api.coords.WorldPoint... vertices)
      Creates a complex shape (e.g., L-shape) from vertices.
      GameArea createReachableArea​(net.runelite.api.coords.WorldPoint center, int range, boolean ignoreCollision)
      Creates an area based on movement reachability (BFS).
      • Methods inherited from class java.lang.Object

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

      • AreaService

        public AreaService()
    • Method Detail

      • createAreaFromRadius

        public GameArea createAreaFromRadius​(net.runelite.api.coords.WorldPoint center,
                                             int radius)
        Creates a square area around a center point.
        Parameters:
        center - The center of the radius
        radius - The distance from the center to the outside edge of the area
        Returns:
        GameArea the game area containing the WorldPoints within the radius
      • createReachableArea

        public GameArea createReachableArea​(net.runelite.api.coords.WorldPoint center,
                                            int range,
                                            boolean ignoreCollision)
        Creates an area based on movement reachability (BFS). Uses your existing TileService logic.
        Parameters:
        center - The center of the reachable area
        range - The range that the reachable area should extend to
        ignoreCollision - True if collision maps should be ignored when generating the game area
        Returns:
        GameArea the game area containing the WorldPoints within the radius
      • createPolygonArea

        public GameArea createPolygonArea​(java.util.List<net.runelite.api.coords.WorldPoint> vertices)
        Creates a complex shape from a list of vertices. This rasterizes the polygon: it finds all discrete tiles inside the shape.
        Parameters:
        vertices - A list of vertices
        Returns:
        GameArea the game area containing the WorldPoints within the specified vertices
      • createPolygonArea

        public GameArea createPolygonArea​(net.runelite.api.coords.WorldPoint... vertices)
        Creates a complex shape (e.g., L-shape) from vertices. This rasterizes the polygon: it finds all discrete tiles inside the shape.
        Parameters:
        vertices - A set of vertices making up the bounds of the polygon area
        Returns:
        GameArea the game area containing the WorldPoints within the specified vertices
      • createFromPoints

        public GameArea createFromPoints​(java.util.Collection<net.runelite.api.coords.WorldPoint> points)
        Creates an area from a raw collection of points. This must include all world points within a given "outline" of an area (i.e. the vertices making up a polygon). If you want to use an outline and generate the internal world points for an area use createPolygonArea() instead.
        Parameters:
        points - A set of WorldPoint objects used to create an area.
        Returns:
        GameArea the game area containing the WorldPoints specified in the set.