Package rs.kreme.ksbot.api.queries
Class TileObjectQuery
- java.lang.Object
-
- rs.kreme.ksbot.api.queries.Query<KSObject,TileObjectQuery>
-
- rs.kreme.ksbot.api.queries.TileObjectQuery
-
public class TileObjectQuery extends Query<KSObject,TileObjectQuery>
A query class for filtering and retrieving tile objects based on various criteria.
-
-
Constructor Summary
Constructors Constructor Description TileObjectQuery(java.util.Collection<KSObject> ts)
Constructs a TileObjectQuery with the specified collection of tile objects.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description TileObjectQuery
atLocation(net.runelite.api.coords.WorldPoint... location)
Filters the tile objects at specific locations.KSObject
closest()
Retrieves the closest tile object to the player's current location.TileObjectQuery
inArea(net.runelite.api.coords.WorldArea area)
Filters the tile objects within a specific WorldArea.KSObject
nearestToPlayer()
Retrieves the tile object nearest to the player's current location.KSObject
nearestToPoint(net.runelite.api.coords.WorldPoint point)
Retrieves the tile object nearest to a specific WorldPoint.TileObjectQuery
notAtLocations(net.runelite.api.coords.WorldPoint... location)
Filters out the tile objects at specific locations.TileObjectQuery
withImposterId(int id)
TileObjectQuery
withinDistance(int distance)
Filters the tile objects within the specified distance from the player's current location.-
Methods inherited from class rs.kreme.ksbot.api.queries.Query
count, empty, exists, filter, first, first, last, list, list, max, min, omit, omit, omit, random, shuffledList, shuffledList, sorted, stream, unique, withId, withName, withNameOrId, withOption, withoutId, withoutName, withoutNameOrId, withoutOption
-
-
-
-
Constructor Detail
-
TileObjectQuery
public TileObjectQuery(java.util.Collection<KSObject> ts)
Constructs a TileObjectQuery with the specified collection of tile objects.- Parameters:
ts
- the collection of KSTileObject instances to query.
-
-
Method Detail
-
withinDistance
public TileObjectQuery withinDistance(int distance)
Filters the tile objects within the specified distance from the player's current location.- Parameters:
distance
- the maximum distance to filter by.- Returns:
- the updated TileObjectQuery instance with filtered tile objects.
-
withImposterId
public TileObjectQuery withImposterId(int id)
-
atLocation
public TileObjectQuery atLocation(net.runelite.api.coords.WorldPoint... location)
Filters the tile objects at specific locations.- Parameters:
location
- one or more WorldPoint locations to filter by.- Returns:
- the updated TileObjectQuery instance with tile objects at the specified locations.
-
notAtLocations
public TileObjectQuery notAtLocations(net.runelite.api.coords.WorldPoint... location)
Filters out the tile objects at specific locations.- Parameters:
location
- one or more WorldPoint locations to exclude.- Returns:
- the updated TileObjectQuery instance with tile objects not at the specified locations.
-
nearestToPlayer
public KSObject nearestToPlayer()
Retrieves the tile object nearest to the player's current location.- Returns:
- the nearest KSTileObject instance, or null if no object is found.
-
closest
public KSObject closest()
Retrieves the closest tile object to the player's current location.- Returns:
- the closest KSTileObject instance, or null if no object is found.
-
nearestToPoint
public KSObject nearestToPoint(net.runelite.api.coords.WorldPoint point)
Retrieves the tile object nearest to a specific WorldPoint.- Parameters:
point
- the WorldPoint to measure distance from.- Returns:
- the nearest KSTileObject instance to the specified point, or null if no object is found.
-
inArea
public TileObjectQuery inArea(net.runelite.api.coords.WorldArea area)
Filters the tile objects within a specific WorldArea.- Parameters:
area
- the WorldArea to filter by.- Returns:
- the updated TileObjectQuery instance with tile objects within the specified area.
-
-