Package rsb.wrappers

Class RSArea

java.lang.Object
rsb.wrappers.RSArea

public class RSArea extends Object
Represents a shape made of RSTiles.
Author:
GigiaJ
  • Constructor Details

    • RSArea

      public RSArea(RSTile[] tiles, int plane)
      Parameters:
      tiles - An Array containing of RSTiles forming a polygon shape.
      plane - The plane of the RSArea.
    • RSArea

      public RSArea(RSTile[] tiles)
      Parameters:
      tiles - An Array containing of RSTiles forming a polygon shape.
    • RSArea

      public RSArea(RSTile sw, RSTile ne, int plane)
      Parameters:
      sw - The South West RSTile of the RSArea
      ne - The North East RSTile of the RSArea
      plane - The plane of the RSArea.
    • RSArea

      public RSArea(RSTile sw, RSTile ne)
      Parameters:
      sw - The South West RSTile of the RSArea
      ne - The North East RSTile of the RSArea
    • RSArea

      public RSArea(int swX, int swY, int neX, int neY)
      Parameters:
      swX - The X axle of the South West RSTile of the RSArea
      swY - The Y axle of the South West RSTile of the RSArea
      neX - The X axle of the North East RSTile of the RSArea
      neY - The Y axle of the North East RSTile of the RSArea
    • RSArea

      public RSArea(int swX, int swY, int neX, int neY, int p)
      Parameters:
      swX - The X axle of the South West RSTile of the RSArea
      swY - The Y axle of the South West RSTile of the RSArea
      neX - The X axle of the North East RSTile of the RSArea
      neY - The Y axle of the North East RSTile of the RSArea
      p - The plane of the RSArea
    • RSArea

      public RSArea(Positionable positionable, int radius)
      Creates an area with the given tile as the center and the sides being the given radius from the center tile
      Parameters:
      positionable - The tile to be the center of the area
      radius - The radius of the area
  • Method Details

    • contains

      public boolean contains(net.runelite.api.coords.WorldPoint point)
    • contains

      public boolean contains(int x, int y)
      Parameters:
      x - The x location of the RSTile that will be checked.
      y - The y location of the RSTile that will be checked.
      Returns:
      True if the RSArea contains the given RSTile.
    • contains

      public boolean contains(int plane, RSTile... tiles)
      Parameters:
      plane - The plane to check.
      tiles - The RSTile(s) that will be checked.
      Returns:
      True if the RSArea contains the given RSTile(s).
    • contains

      public boolean contains(RSTile... tiles)
      Parameters:
      tiles - The RSTile(s) that will be checked.
      Returns:
      True if the RSArea contains the given RSTile(s).
    • getCentralTile

      public RSTile getCentralTile()
      Returns:
      The central RSTile of the RSArea.
    • getNearestTile

      public RSTile getNearestTile(RSTile base)
      Parameters:
      base - The base tile to measure the closest tile off of.
      Returns:
      The nearest RSTile in the RSArea to the given RSTile.
    • getTileArray

      public RSTile[] getTileArray()
      Returns:
      The RSTiles the RSArea contains.
    • getTiles

      public RSTile[][] getTiles()
      Returns:
      The RSTiles the RSArea contains.
    • getRandomTile

      public RSTile getRandomTile()
      Returns:
      a random RSTile in the RSArea
    • getWidth

      public int getWidth()
      Returns:
      The distance between the the RSTile that's most East and the RSTile that's most West.
    • getHeight

      public int getHeight()
      Returns:
      The distance between the the RSTile that's most South and the RSTile that's most North.
    • getX

      public int getX()
      Returns:
      The X axle of the RSTile that's most West.
    • getY

      public int getY()
      Returns:
      The Y axle of the RSTile that's most South.
    • getPlane

      public int getPlane()
      Returns:
      The plane of the RSArea.
    • getBounds

      public Rectangle getBounds()
      Returns:
      The bounding box of the RSArea.