Interface Positionable
-
- All Known Subinterfaces:
RSActor,RSBoundaryObject,RSFloorDecoration,RSGameObject,RSGraphicsObject,RSItemLayer,RSNPC,RSPlayer,RSTile,RSTileObject,RSWallDecoration,Tile
- All Known Implementing Classes:
BankLocation,Character,ClientInstance,Entity,GameObject,GraphicsObject,GroundItem,LocalTile,NPC,Player,RegionTile,SceneTile,WorldTile
public interface Positionable
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description default booleancanReach()default booleancanReach(Positionable positionable)default booleancanReachSurrounding()default booleancanReachSurrounding(Positionable positionable)default Positionablederive(int x, int y)default Positionablederive(Direction direction)default Positionablederive(Direction direction, int steps)default doubledistance()Gets the distance between this positionable and the local player.default doubledistance(Positionable other)Find the straight-line distance from this positionable to another positionable.default intdistanceTo(Positionable other)Gets the distance between this positionable and another.default intdistanceTo2D(Positionable other)Find the distance from this positionable to another positionable.default doubledistanceTo2DHypotenuse(Positionable other)Find the straight-line distance from this positionable to another positionable.default doubledistanceToHypotenuse(Positionable other)Gets the straight-line distance between this positionable and another.default intdistanceToPath(Positionable other)Gets the path distance from this position to another.default voiddraw(java.awt.Graphics2D gg, java.awt.Color color)default voiddrawMinimapDot(java.awt.Graphics2D gg, java.awt.Color color)default voiddrawText(java.awt.Graphics2D gg, java.lang.String text, int zOffset)default net.eternalclient.api.data.PointgetCanvasTextLocation(java.awt.Graphics2D gg, java.lang.String text, int zOffset)default java.awt.PolygongetCanvasTilePoly()default intGetChunkRotation()default intgetHeight()default LocalTilegetLocalTile()default intgetLocalX()default intgetLocalY()default net.eternalclient.api.data.PointgetMinimapPoint()default java.util.Set<MovementFlag>getMovementFlags()intgetPlane()default RectAreagetRectArea()default intgetRegionId()default RegionTilegetRegionTile()default intgetRegionX()default intgetRegionY()default SceneTilegetSceneTile()default intgetSceneX()default intgetSceneY()default RectAreagetSurroundingArea(int radius)default PositionablegetWalkableTile(int radius)Gets a walkable tile within a certain radius of this positionable.default intgetWidth()default WorldTilegetWorldTile()RSWorldViewgetWorldView()intgetWorldX()intgetWorldY()default booleanhasLineOfSightTo()Checks if this positionable has line of sight to the local player.default booleanhasLineOfSightTo(Positionable other)Checks if this positionable has line of sight to another positionable.default booleaninLineOfSight()Checks if this positionable is in the line of sight of the local player.default booleanisInArea(RectArea area)Checks whether this tile is located within the given area.default booleanisInArea(RectArea... areas)Checks whether this tile is located within any of the given areas.default booleanisInArea2D(RectArea area)Checks whether this tile is located within the given area, disregarding any plane differences.default booleanisInArea2D(RectArea... areas)Checks whether this tile is located within any of the given areas, disregarding any plane differences.default booleanisInMeleeDistance(Positionable positionable)default booleanisInScene()default booleanisUnderRoof()default booleanlocatedAt(Positionable positionable)default java.util.List<Positionable>pathTo(Positionable other)Determine the checkpoint tiles of a server-sided path from this Positionable to another Positionable.default intwalkingDistance()
-
-
-
Method Detail
-
getWorldView
RSWorldView getWorldView()
-
getPlane
int getPlane()
-
getWorldX
int getWorldX()
-
getWorldY
int getWorldY()
-
getSceneX
default int getSceneX()
-
getSceneY
default int getSceneY()
-
getLocalX
default int getLocalX()
-
getLocalY
default int getLocalY()
-
getRegionX
default int getRegionX()
-
getRegionY
default int getRegionY()
-
getRegionId
default int getRegionId()
-
getWidth
default int getWidth()
-
getHeight
default int getHeight()
-
isInScene
default boolean isInScene()
-
getRectArea
default RectArea getRectArea()
-
getSurroundingArea
default RectArea getSurroundingArea(int radius)
-
getWorldTile
default WorldTile getWorldTile()
-
getSceneTile
default SceneTile getSceneTile()
-
getLocalTile
default LocalTile getLocalTile()
-
getRegionTile
default RegionTile getRegionTile()
-
derive
default Positionable derive(int x, int y)
-
derive
default Positionable derive(Direction direction)
-
derive
default Positionable derive(Direction direction, int steps)
-
locatedAt
default boolean locatedAt(Positionable positionable)
-
isInMeleeDistance
default boolean isInMeleeDistance(Positionable positionable)
-
isInArea
default boolean isInArea(RectArea area)
Checks whether this tile is located within the given area.- Parameters:
area- area to check within- Returns:
trueif area contains this point,falseotherwise.
-
isInArea
default boolean isInArea(RectArea... areas)
Checks whether this tile is located within any of the given areas.- Parameters:
areas- areas to check within- Returns:
trueif any area contains this point,falseotherwise.
-
isInArea2D
default boolean isInArea2D(RectArea area)
Checks whether this tile is located within the given area, disregarding any plane differences.- Parameters:
area- area to check within- Returns:
trueif area contains this point,falseotherwise.
-
isInArea2D
default boolean isInArea2D(RectArea... areas)
Checks whether this tile is located within any of the given areas, disregarding any plane differences.- Parameters:
areas- areas to check within- Returns:
trueif any area contains this point,falseotherwise.
-
distance
default double distance()
Gets the distance between this positionable and the local player.This method disregards the plane value of this positionable and the local player and returns the simple distance between the X-Z coordinate pairs. same as
distanceTo2DHypotenuse(Positionable)
-
distance
default double distance(Positionable other)
Find the straight-line distance from this positionable to another positionable.This method disregards the plane value of the two positionable and returns the simple distance between the X-Z coordinate pairs. same as
distanceTo2DHypotenuse(Positionable)- Parameters:
other- other tile- Returns:
- the straight-line distance
-
distanceTo
default int distanceTo(Positionable other)
Gets the distance between this positionable and another.If the other positionable is not on the same plane, this method will return
Integer.MAX_VALUE. If ignoring the plane is wanted, use thedistanceTo2D(Positionable)method.- Parameters:
other- other positionable- Returns:
- the distance
-
distanceTo2D
default int distanceTo2D(Positionable other)
Find the distance from this positionable to another positionable.This method disregards the plane value of the two positionable and returns the simple distance between the X-Z coordinate pairs.
- Parameters:
other- other positionable- Returns:
- the distance
-
distanceToHypotenuse
default double distanceToHypotenuse(Positionable other)
Gets the straight-line distance between this positionable and another.If the other positionable is not on the same plane, this method will return
Double.MAX_VALUE. If ignoring the plane is wanted, use thedistanceTo2DHypotenuse(Positionable)method.- Parameters:
other- other positionable- Returns:
- the straight-line distance
-
distanceTo2DHypotenuse
default double distanceTo2DHypotenuse(Positionable other)
Find the straight-line distance from this positionable to another positionable.This method disregards the plane value of the two positionable and returns the simple distance between the X-Z coordinate pairs.
- Parameters:
other- other tile- Returns:
- the straight-line distance
-
isUnderRoof
default boolean isUnderRoof()
-
getMovementFlags
default java.util.Set<MovementFlag> getMovementFlags()
-
GetChunkRotation
default int GetChunkRotation()
-
inLineOfSight
default boolean inLineOfSight()
Checks if this positionable is in the line of sight of the local player.- Returns:
- true if this positionable is in the line of sight of the local player, false otherwise
-
hasLineOfSightTo
default boolean hasLineOfSightTo()
Checks if this positionable has line of sight to the local player.- Returns:
- true if this positionable has line of sight to the local player, false otherwise
-
hasLineOfSightTo
default boolean hasLineOfSightTo(Positionable other)
Checks if this positionable has line of sight to another positionable.- Parameters:
other- the other positionable- Returns:
- true if this positionable has line of sight to the other positionable, false otherwise
-
getMinimapPoint
default net.eternalclient.api.data.Point getMinimapPoint()
-
getCanvasTilePoly
default java.awt.Polygon getCanvasTilePoly()
-
getCanvasTextLocation
default net.eternalclient.api.data.Point getCanvasTextLocation(java.awt.Graphics2D gg, java.lang.String text, int zOffset)
-
draw
default void draw(java.awt.Graphics2D gg, java.awt.Color color)
-
drawText
default void drawText(java.awt.Graphics2D gg, java.lang.String text, int zOffset)
-
drawMinimapDot
default void drawMinimapDot(java.awt.Graphics2D gg, java.awt.Color color)
-
getWalkableTile
default Positionable getWalkableTile(int radius)
Gets a walkable tile within a certain radius of this positionable.This is only within the loaded Scene.
- Parameters:
radius- The radius to search for a walkable tile.- Returns:
- Returns the walkable tile or null if none found or this positionable is not in the scene.
-
walkingDistance
default int walkingDistance()
-
canReach
default boolean canReach()
-
canReach
default boolean canReach(Positionable positionable)
-
canReachSurrounding
default boolean canReachSurrounding()
-
canReachSurrounding
default boolean canReachSurrounding(Positionable positionable)
-
distanceToPath
default int distanceToPath(Positionable other)
Gets the path distance from this position to another.If the other point is unreachable, this method will return
Integer.MAX_VALUE.- Parameters:
other-- Returns:
- Returns the path distance
-
pathTo
default java.util.List<Positionable> pathTo(Positionable other)
Determine the checkpoint tiles of a server-sided path from this Positionable to another Positionable.The checkpoint tiles of a path are the "corner tiles" of a path and determine the path completely.
Note that true server-sided pathfinding uses collisiondata of the 128x128 area around this Positionable, while the client only has access to collisiondata within the 104x104 loaded area. This means that the results would differ in case the server's path goes near (or over) the border of the loaded area.
- Parameters:
other- The other WorldTile to compare with- Returns:
- Returns the checkpoint tiles of the path
-
-