Class GraphicsObjectQuery
java.lang.Object
privbot.query.GraphicsObjectQuery
Fluent query for scene graphics objects (e.g. falling crystal/acid gfx).
-
Constructor Summary
ConstructorsConstructorDescriptionGraphicsObjectQuery(List<net.runelite.api.GraphicsObject> raw, net.runelite.api.Client client) Wraps a copy ofraw; plugins normally get a query fromctx.graphics.query(). -
Method Summary
Modifier and TypeMethodDescriptionnet.runelite.api.GraphicsObjectclosest()The graphic nearest the local player in tile steps, ignoring other planes (null if none is on the player's plane).net.runelite.api.GraphicsObjectNarrows bypredicate(in place), then returns the closest match.booleanempty()True when no entry is left.Narrows this query in place and returns it.net.runelite.api.GraphicsObjectfirst()The first remaining entry in snapshot order, or null when the query is empty.net.runelite.api.GraphicsObjectNarrows bypredicate(in place) and returns the first match, or null.List<net.runelite.api.GraphicsObject> list()An unmodifiable view of the remaining entries.net.runelite.api.GraphicsObjectnearest()Alias ofclosest().net.runelite.api.GraphicsObjectAlias ofclosest(Predicate).intsize()The number of entries left.Alias offilter(Predicate).withId(int... ids) Keeps graphics whose spot-animation id is one ofids; no ids leaves the query unchanged.withinTiles(int maxTiles) Keeps graphics withinmaxTilestile steps (Chebyshev) of the local player, on the player's plane.
-
Constructor Details
-
GraphicsObjectQuery
public GraphicsObjectQuery(List<net.runelite.api.GraphicsObject> raw, net.runelite.api.Client client) Wraps a copy ofraw; plugins normally get a query fromctx.graphics.query().
-
-
Method Details
-
withId
Keeps graphics whose spot-animation id is one ofids; no ids leaves the query unchanged. -
withinTiles
Keeps graphics withinmaxTilestile steps (Chebyshev) of the local player, on the player's plane. Unchanged when the player position cannot be read ormaxTilesis negative. -
filter
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
Alias offilter(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 bypredicate(in place), then returns the closest match. -
nearest
public net.runelite.api.GraphicsObject nearest()Alias ofclosest(). -
nearest
public net.runelite.api.GraphicsObject nearest(Predicate<net.runelite.api.GraphicsObject> predicate) Alias ofclosest(Predicate). -
first
public net.runelite.api.GraphicsObject first()The first remaining entry in snapshot order, or null when the query is empty. -
first
Narrows bypredicate(in place) and returns the first match, or null. -
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.
-