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 Deprecated 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)
Creates a square area from this tile with a given 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()
Gets the onscreen polygon for this tileTile
getRandomized()
Gets a new instance of a random tile with a deviation of a guassian random with a mean of 2 and a sigma of 1Tile
getRandomized(int deviation)
Gets a new instance of a random tile within a given deviation.Tile
getRandomizedTile()
Deprecated.seegetRandomized()
Tile
getRandomizedTile(int deviation)
Deprecated.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 reference's location by the specified amount and returns itselfTile
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 pathfinding to the given tile.-
Methods inherited from interface org.dreambot.api.wrappers.interactive.Locatable
canReach, canReach, tileDistance
-
-
-
-
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 reference's location by the specified amount and returns itself- 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, Integer.MAX_VALUE if the entity is null
-
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 pathfinding to the given tile.This is a more expensive call than
Locatable.distance(Tile)
, 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()
Gets the onscreen polygon for this tile
-
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
@Deprecated public Tile getRandomizedTile()
Deprecated.seegetRandomized()
-
getRandomized
public Tile getRandomized()
Gets a new instance of a random tile with a deviation of a guassian random with a mean of 2 and a sigma of 1
-
getRandomizedTile
@Deprecated public Tile getRandomizedTile(int deviation)
Deprecated.
-
getRandomized
public Tile getRandomized(int deviation)
Gets a new instance of a random tile within a given deviation.- Parameters:
deviation
-- Returns:
-
getArea
public Area getArea(int radius)
Creates a square area from this tile with a given radius.
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
-