Package rs.kreme.ksbot.api.game.pathing
Class DangerousTile
- java.lang.Object
-
- rs.kreme.ksbot.api.game.pathing.DangerousTile
-
public class DangerousTile extends java.lang.ObjectRepresents a dangerous area in the game world with configurable damage and reaction radii. Used for pathfinding algorithms to calculate safe paths around hazardous tiles.
-
-
Constructor Summary
Constructors Constructor Description DangerousTile(net.runelite.api.coords.LocalPoint point)Creates a blocking tile (with no damage/reaction area) at the specified local pointDangerousTile(net.runelite.api.coords.LocalPoint point, int damageRadius, int reactRadius)Creates a dangerous tile with specified damage and reaction radiiDangerousTile(net.runelite.api.coords.WorldPoint point)Creates a blocking tile (with no damage/reaction area) at the specified world pointDangerousTile(net.runelite.api.coords.WorldPoint point, int damageRadius, int reactRadius)Creates a dangerous tile with specified damage and reaction radii
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static doubledistanceTo(net.runelite.api.coords.LocalPoint a, net.runelite.api.coords.LocalPoint b)Calculates the Euclidean distance between two local pointsbooleanequals(java.lang.Object obj)Checks if this dangerous tile equals another objectintgetDamageRadius()Gets the damage radius of this dangerous tilenet.runelite.api.coords.WorldPointgetPoint()Gets the world point location of this dangerous tileintgetReactRadius()Gets the reaction radius of this dangerous tileinthashCode()Computes a hash code for this dangerous tilebooleanisWithinDamageRadius(net.runelite.api.coords.WorldPoint other)Checks if a world point is within the damage radius of this dangerous tilebooleanisWithinReactRadius(net.runelite.api.coords.WorldPoint other)Checks if a world point is within the reaction radius of this dangerous tilebooleanisWithinReactRadius(net.runelite.api.coords.WorldPoint other, int extraRadius)Checks if a world point is within the reaction radius plus an additional bufferjava.lang.StringtoString()Gets a string representation of this dangerous tile
-
-
-
Constructor Detail
-
DangerousTile
public DangerousTile(net.runelite.api.coords.WorldPoint point, int damageRadius, int reactRadius)Creates a dangerous tile with specified damage and reaction radii- Parameters:
point- The world point location of the dangerdamageRadius- The radius (in tiles) where damage occursreactRadius- The radius (in tiles) where the player should react- Throws:
java.lang.IllegalArgumentException- if point is null or radii are negative
-
DangerousTile
public DangerousTile(net.runelite.api.coords.LocalPoint point, int damageRadius, int reactRadius)Creates a dangerous tile with specified damage and reaction radii- Parameters:
point- The local point location of the dangerdamageRadius- The radius (in tiles) where damage occursreactRadius- The radius (in tiles) where the player should react- Throws:
java.lang.IllegalArgumentException- if point is null or radii are negative
-
DangerousTile
public DangerousTile(net.runelite.api.coords.WorldPoint point)
Creates a blocking tile (with no damage/reaction area) at the specified world point- Parameters:
point- The world point location to block- Throws:
java.lang.IllegalArgumentException- if point is null
-
DangerousTile
public DangerousTile(net.runelite.api.coords.LocalPoint point)
Creates a blocking tile (with no damage/reaction area) at the specified local point- Parameters:
point- The local point location to block- Throws:
java.lang.IllegalArgumentException- if point is null
-
-
Method Detail
-
getPoint
public net.runelite.api.coords.WorldPoint getPoint()
Gets the world point location of this dangerous tile- Returns:
- The world point of this dangerous tile
-
getDamageRadius
public int getDamageRadius()
Gets the damage radius of this dangerous tile- Returns:
- The radius (in tiles) where damage occurs
-
getReactRadius
public int getReactRadius()
Gets the reaction radius of this dangerous tile- Returns:
- The radius (in tiles) where the player should react
-
distanceTo
public static double distanceTo(net.runelite.api.coords.LocalPoint a, net.runelite.api.coords.LocalPoint b)Calculates the Euclidean distance between two local points- Parameters:
a- The first local pointb- The second local point- Returns:
- The distance between the two points
-
isWithinDamageRadius
public boolean isWithinDamageRadius(net.runelite.api.coords.WorldPoint other)
Checks if a world point is within the damage radius of this dangerous tile- Parameters:
other- The world point to check- Returns:
- true if the point is within the damage radius
-
isWithinReactRadius
public boolean isWithinReactRadius(net.runelite.api.coords.WorldPoint other)
Checks if a world point is within the reaction radius of this dangerous tile- Parameters:
other- The world point to check- Returns:
- true if the point is within the reaction radius
-
isWithinReactRadius
public boolean isWithinReactRadius(net.runelite.api.coords.WorldPoint other, int extraRadius)Checks if a world point is within the reaction radius plus an additional buffer- Parameters:
other- The world point to checkextraRadius- Additional radius to add to the reaction radius- Returns:
- true if the point is within the expanded reaction radius
-
toString
public java.lang.String toString()
Gets a string representation of this dangerous tile- Overrides:
toStringin classjava.lang.Object- Returns:
- A string with position and radius information
-
equals
public boolean equals(java.lang.Object obj)
Checks if this dangerous tile equals another object- Overrides:
equalsin classjava.lang.Object- Parameters:
obj- The object to compare with- Returns:
- true if the objects are equal
-
hashCode
public int hashCode()
Computes a hash code for this dangerous tile- Overrides:
hashCodein classjava.lang.Object- Returns:
- A hash code value
-
-