Class GraphicsObjectQuery

java.lang.Object
privbot.query.GraphicsObjectQuery

public final class GraphicsObjectQuery extends Object
Fluent query for scene graphics objects (e.g. falling crystal/acid gfx).
  • Constructor Summary

    Constructors
    Constructor
    Description
    GraphicsObjectQuery(List<net.runelite.api.GraphicsObject> raw, net.runelite.api.Client client)
    Wraps a copy of raw; plugins normally get a query from ctx.graphics.query().
  • Method Summary

    Modifier and Type
    Method
    Description
    net.runelite.api.GraphicsObject
    The graphic nearest the local player in tile steps, ignoring other planes (null if none is on the player's plane).
    net.runelite.api.GraphicsObject
    closest(Predicate<net.runelite.api.GraphicsObject> predicate)
    Narrows by predicate (in place), then returns the closest match.
    boolean
    True when no entry is left.
    filter(Predicate<net.runelite.api.GraphicsObject> predicate)
    Narrows this query in place and returns it.
    net.runelite.api.GraphicsObject
    The first remaining entry in snapshot order, or null when the query is empty.
    net.runelite.api.GraphicsObject
    first(Predicate<net.runelite.api.GraphicsObject> predicate)
    Narrows by predicate (in place) and returns the first match, or null.
    List<net.runelite.api.GraphicsObject>
    An unmodifiable view of the remaining entries.
    net.runelite.api.GraphicsObject
    Alias of closest().
    net.runelite.api.GraphicsObject
    nearest(Predicate<net.runelite.api.GraphicsObject> predicate)
    int
    The number of entries left.
    where(Predicate<net.runelite.api.GraphicsObject> predicate)
    withId(int... ids)
    Keeps graphics whose spot-animation id is one of ids; no ids leaves the query unchanged.
    withinTiles(int maxTiles)
    Keeps graphics within maxTiles tile steps (Chebyshev) of the local player, on the player's plane.

    Methods inherited from class java.lang.Object

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

    • GraphicsObjectQuery

      public GraphicsObjectQuery(List<net.runelite.api.GraphicsObject> raw, net.runelite.api.Client client)
      Wraps a copy of raw; plugins normally get a query from ctx.graphics.query().
  • Method Details

    • withId

      public GraphicsObjectQuery withId(int... ids)
      Keeps graphics whose spot-animation id is one of ids; no ids leaves the query unchanged.
    • withinTiles

      public GraphicsObjectQuery withinTiles(int maxTiles)
      Keeps graphics within maxTiles tile steps (Chebyshev) of the local player, on the player's plane. Unchanged when the player position cannot be read or maxTiles is negative.
    • filter

      public GraphicsObjectQuery filter(Predicate<net.runelite.api.GraphicsObject> predicate)
      Narrows this query in place and returns it. Queries are mutable and single-use; the predicate runs on the calling thread. A null predicate is ignored.
    • where

      public GraphicsObjectQuery where(Predicate<net.runelite.api.GraphicsObject> predicate)
    • closest

      public net.runelite.api.GraphicsObject closest()
      The graphic nearest the local player in tile steps, ignoring other planes (null if none is on the player's plane). Returns the first entry when the player position cannot be read.
    • closest

      public net.runelite.api.GraphicsObject closest(Predicate<net.runelite.api.GraphicsObject> predicate)
      Narrows by predicate (in place), then returns the closest match.
    • nearest

      public net.runelite.api.GraphicsObject nearest()
      Alias of closest().
    • nearest

      public net.runelite.api.GraphicsObject nearest(Predicate<net.runelite.api.GraphicsObject> predicate)
    • first

      public net.runelite.api.GraphicsObject first()
      The first remaining entry in snapshot order, or null when the query is empty.
    • first

      public net.runelite.api.GraphicsObject first(Predicate<net.runelite.api.GraphicsObject> predicate)
      Narrows by predicate (in place) and returns the first match, or null.
    • list

      public List<net.runelite.api.GraphicsObject> list()
      An unmodifiable view of the remaining entries.
    • empty

      public boolean empty()
      True when no entry is left.
    • size

      public int size()
      The number of entries left.