Class SafeTiles
What it proves: the returned tile passed standable, reachable, is not dangerous in the
HazardMap at nowTick and has Footprint.gap(int, int, int, int, int) at least minGap from every NPC in
avoid. Nothing is read from the scene: the caller supplies both predicates, so "standable" and
"reachable" mean whatever the caller's collision data says.
Unreadable looks like: the result is null when no tile within the radius qualifies, never the
start tile. An avoid entry with no tile is skipped, and so is one on another plane than from (it has no
footprint on this plane). An avoid entry whose size is unknown (NpcView.size() 0) is treated
conservatively as 5x5 from its tile, which covers every
NPC up to that size; see NpcView.tile() for how its tile is chosen in that case.
Thread rule: pure, safe on any thread, but the predicates are called on the caller's thread; make them cheap and thread-safe for that thread.
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final intThe edge length an avoid-NPC of unknown size (0) is treated as. -
Method Summary
Modifier and TypeMethodDescriptionstatic net.runelite.api.coords.WorldPointnearest(net.runelite.api.coords.WorldPoint from, int radius, Predicate<net.runelite.api.coords.WorldPoint> standable, Predicate<net.runelite.api.coords.WorldPoint> reachable, HazardMap hazards, int nowTick, List<NpcView> avoid, int minGap) Searches rings by Chebyshev radius 1..radiusaroundfrom, skippingfromitself.
-
Field Details
-
UNKNOWN_SIZE_ASSUMED
public static final int UNKNOWN_SIZE_ASSUMEDThe edge length an avoid-NPC of unknown size (0) is treated as.- See Also:
-
-
Method Details
-
nearest
public static net.runelite.api.coords.WorldPoint nearest(net.runelite.api.coords.WorldPoint from, int radius, Predicate<net.runelite.api.coords.WorldPoint> standable, Predicate<net.runelite.api.coords.WorldPoint> reachable, HazardMap hazards, int nowTick, List<NpcView> avoid, int minGap) Searches rings by Chebyshev radius 1..radiusaroundfrom, skippingfromitself. The first ring with a qualifying tile decides: within it the smallest Euclidean distance wins, ties go to the smaller x and then the smaller y. The result is onfrom's plane.
-