Constructor and Description |
---|
Position(int x,
int y,
int z)
Constructs a new position
|
Position(Vector3D vector)
Constructs a position using a
Vector3D |
Modifier and Type | Method and Description |
---|---|
int |
distance(Position p)
Gets the distance between this position and the specified position using the Pythagoras algorithm.
|
int |
distance(Vector3D v)
Gets the distance between this position and the specified position using the Pythagoras algorithm.
|
boolean |
equals(java.lang.Object obj) |
Area |
getArea(int radius)
Gets an
Area with this position as center |
int |
getCrossProduct(Position p)
Deprecated.
|
int |
getGridX(Bot bot)
Gets the grid x value.
|
int |
getGridY(Bot bot)
Gets the grid y value.
|
int |
getLocalX(Bot bot)
Gets the grid x value.
|
int |
getLocalY(Bot bot)
Gets the grid y value.
|
java.awt.Polygon |
getPolygon(Bot bot)
Gets a polygon constructed from the corner vertices of this position with a hardcoded height value.
|
java.awt.Polygon |
getPolygon(Bot bot,
int height)
Gets a polygon constructed from the corner vertices of this position.
|
int |
getTileHeight(Bot bot)
Gets the tile height for this position.
|
short[][] |
getVertices(Bot bot)
Gets the array of the tile vertices for this position.
|
short[][] |
getVertices(Bot bot,
int height)
Gets the array of the tile vertices for this position.
|
int |
getX()
Gets the x coordinate of this position.
|
int |
getY()
Gets the y coordinate of this position.
|
int |
getZ()
Gets the z coordinate of this position.
|
static int |
hash(int x,
int y,
int z) |
int |
hashCode()
Deprecated.
|
boolean |
hover(Bot bot)
Hovers over this tile in the main-screen.
|
boolean |
interact(Bot bot,
java.lang.String... actions)
Interacts with this tile in the main-screen.
|
boolean |
isOnMiniMap(Bot bot)
Checks if a tile is visible on the minimap.
|
boolean |
isVisible(Bot bot)
Returns true if all four tile vertices lie within the main screen view clipping mask.
|
java.lang.String |
toString()
Returns this position in string format (x=this.x, y=this.y, z=this.y).
|
Position |
translate(int x,
int y)
Creates a cloned instance of this position with
the given translation.
|
Position |
translate(int x,
int y,
int z)
Creates a cloned instance of this position with
the given translation.
|
public Position(Vector3D vector)
Vector3D
vector
- The vector values to usepublic Position(int x, int y, int z)
x
- The x valuey
- The y valuez
- The z valuepublic static int hash(int x, int y, int z)
public int getX()
public int getY()
public int getZ()
@Deprecated public int getCrossProduct(Position p)
public int distance(Vector3D v)
v
- The vector/position to calculate the distance to from this position.public int distance(Position p)
p
- The position to calculate the distance to from this position.public boolean equals(java.lang.Object obj)
equals
in class java.lang.Object
@Deprecated public int hashCode()
hashCode
in class java.lang.Object
public java.lang.String toString()
toString
in class java.lang.Object
public int getLocalX(Bot bot)
bot
- The bot instance.public int getLocalY(Bot bot)
bot
- The bot instance.public int getGridX(Bot bot)
bot
- The bot instance.public int getGridY(Bot bot)
bot
- The bot instance.public short[][] getVertices(Bot bot, int height)
bot
- The bot instance.height
- The height on top of the tile.public short[][] getVertices(Bot bot)
bot
- The bot instance.public java.awt.Polygon getPolygon(Bot bot, int height)
bot
- The bot instance.height
- The height, usually 0.public java.awt.Polygon getPolygon(Bot bot)
bot
- The bot instance.public boolean isVisible(Bot bot)
bot
- The Bot instance.public int getTileHeight(Bot bot)
bot
- The bot instance.public boolean interact(Bot bot, java.lang.String... actions)
public boolean hover(Bot bot)
public Position translate(int x, int y)
x
- The x value to translate.y
- The y value to translate.public Position translate(int x, int y, int z)
x
- The x value to translate.y
- The y value to translate.z
- The z value to translate.public boolean isOnMiniMap(Bot bot)
public Area getArea(int radius)
Area
with this position as centerradius
- The distance from the entity you are creating an area from.Area
with this position as center