Package org.dreambot.api.methods.map
Class Tile
- java.lang.Object
-
- org.dreambot.api.methods.map.Tile
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Tile
clone()
double
distance()
Gets the distance between the current Tile and your player.double
distance(Tile tile)
Gets the distance between the current Tile and specified Tiledouble
distance(Entity entity)
Gets the distance of the current Tile to the Entityboolean
equals(java.lang.Object obj)
Area
getArea(int radius)
int
getGridX()
Gets grid (local) X coordinate of the given object.int
getGridY()
Gets grid (local) Y coordinate of the given object.java.awt.Polygon
getPolygon()
Tile
getRandomizedTile()
Tile
getRandomizedTile(int deviation)
Tile
getTile()
Gets tile of the object.TileReference
getTileReference()
Gets tile reference of the given object.int
getX()
Gets the X coordinate of the Tileint
getY()
Gets the Y coordinate of the Tileint
getZ()
Gets the Z coordinate of the tileint
hashCode()
void
setX(int x)
Sets the X coordinate for a Tilevoid
setY(int y)
Sets the Y coordinate of the Tilevoid
setZ(int z)
Sets the Z coordinate of the tilejava.lang.String
toString()
Tile
translate(int x, int y)
Translates this Tile's location by the specified amount and returns then this Tile with the updated location.Tile
translate(Tile tile)
Translates this Tile's location by the specified amount and returns then this Tile with the updated location.double
walkingDistance(Tile tile)
Walking distance based on path finding away from the given tile.
-
-
-
Method Detail
-
translate
public Tile translate(Tile tile)
Translates this Tile's location by the specified amount and returns then this Tile with the updated location.- Parameters:
tile
- the tile which to translate.- Returns:
- this tile with the translated location.
-
translate
public Tile translate(int x, int y)
Translates this Tile's location by the specified amount and returns then this Tile with the updated location.- Parameters:
x
- x by which to translate.y
- y by which to translate.- Returns:
- this tile with the translated location.
-
getX
public int getX()
Gets the X coordinate of the Tile
-
setX
public void setX(int x)
Sets the X coordinate for a Tile- Parameters:
x
- X coordinate
-
getY
public int getY()
Gets the Y coordinate of the Tile
-
setY
public void setY(int y)
Sets the Y coordinate of the Tile- Parameters:
y
- Y coordinate
-
getGridX
public int getGridX()
Description copied from interface:Locatable
Gets grid (local) X coordinate of the given object.
-
getGridY
public int getGridY()
Description copied from interface:Locatable
Gets grid (local) Y coordinate of the given object.
-
getZ
public int getZ()
Gets the Z coordinate of the tile
-
setZ
public void setZ(int z)
Sets the Z coordinate of the tile- Parameters:
z
- Z coordinate
-
getTileReference
public TileReference getTileReference()
Description copied from interface:Locatable
Gets tile reference of the given object.- Specified by:
getTileReference
in interfaceLocatable
- Returns:
- the object tile reference.
-
distance
public double distance(Entity entity)
Gets the distance of the current Tile to the Entity- Parameters:
entity
- Entity to check- Returns:
- Distance between Tile and Entity
-
clone
public Tile clone()
-
distance
public double distance(Tile tile)
Gets the distance between the current Tile and specified Tile
-
walkingDistance
public double walkingDistance(Tile tile)
Description copied from interface:Locatable
Walking distance based on path finding away from the given tile. This is more expensive of a call than distance, and should be used sparingly.- Specified by:
walkingDistance
in interfaceLocatable
- Parameters:
tile
- the destination tile.- Returns:
- return the path distance movement cost from the given tile as a double. If there isn't a path to the tile, it will return 3 times the as the crow flies distance.
-
getPolygon
public java.awt.Polygon getPolygon()
-
distance
public double distance()
Gets the distance between the current Tile and your player.- Returns:
- from the given location.
-
hashCode
public int hashCode()
- Overrides:
hashCode
in classjava.lang.Object
-
equals
public boolean equals(java.lang.Object obj)
- Overrides:
equals
in classjava.lang.Object
-
getRandomizedTile
public Tile getRandomizedTile()
-
getRandomizedTile
public Tile getRandomizedTile(int deviation)
-
getArea
public Area getArea(int radius)
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
-