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 Tileclone()doubledistance()Gets the distance between the current Tile and your player.doubledistance(Tile tile)Gets the distance between the current Tile and specified Tiledoubledistance(Entity entity)Gets the distance of the current Tile to the Entitybooleanequals(java.lang.Object obj)AreagetArea(int radius)Creates a square area from this tile with a given radius.intgetGridX()Gets grid (local) X coordinate of the given object.intgetGridY()Gets grid (local) Y coordinate of the given object.java.awt.PolygongetPolygon()Gets the onscreen polygon for this tileTilegetRandomized()Gets a new instance of a random tile with a deviation of a guassian random with a mean of 2 and a sigma of 1TilegetRandomized(int deviation)Gets a new instance of a random tile within a given deviation.TilegetRandomizedTile()Deprecated.seegetRandomized()TilegetRandomizedTile(int deviation)Deprecated.TilegetTile()Gets tile of the object.TileReferencegetTileReference()Gets tile reference of the given object.intgetX()Gets the X coordinate of the TileintgetY()Gets the Y coordinate of the TileintgetZ()Gets the Z coordinate of the tileinthashCode()voidsetX(int x)Sets the X coordinate for a TilevoidsetY(int y)Sets the Y coordinate of the TilevoidsetZ(int z)Sets the Z coordinate of the tilejava.lang.StringtoString()Tiletranslate(int x, int y)Translates this Tile reference's location by the specified amount and returns itselfTiletranslate(Tile tile)Translates this Tile's location by the specified amount and returns then this Tile with the updated location.doublewalkingDistance(Tile tile)Walking distance based on pathfinding to the given tile.-
Methods inherited from interface org.dreambot.api.wrappers.interactive.Locatable
canReach, canReach, getRegionId, 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:LocatableGets grid (local) X coordinate of the given object.
-
getGridY
public int getGridY()
Description copied from interface:LocatableGets 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:LocatableGets tile reference of the given object.- Specified by:
getTileReferencein 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:LocatableWalking 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:
walkingDistancein 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:
hashCodein classjava.lang.Object
-
equals
public boolean equals(java.lang.Object obj)
- Overrides:
equalsin 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:
toStringin classjava.lang.Object
-
-