Interface Locatable
-
- All Known Implementing Classes:
AbstractWebNode,AgilityWebNode,Area,BankLocation,BankWebNode,BasicWebNode,BoundaryObject,Character,CharterWebNode,Entity,EntranceWebNode,FairyRingWebNode,FloorDecoration,GameObject,GnomeGliderWebNode,GraphicsObject,GroundItem,LovakengjMinecartWebNode,MagicCarpetWebNode,MountainGuideWebNode,NPC,Player,Projectile,QuetzalWebNode,SceneObject,SelfConnectingWebNode,ShipWebNode,SpiritTreeWebNode,TeleportWebNode,Tile,TollWebNode,WallObject
public interface LocatableCreated with IntelliJ IDEA. User: NotoriousPP Date: 7/29/2014 Time: 12:31 PM
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description default booleancanReach()Checks if this location is reachable by the local player without obstaclesdefault booleancanReach(Tile tile)Checks if this location is reachable by the provided tile without obstaclesdefault doubledistance(Tile tile)Distance (as the crow flies) away from the given tile.default intgetGridX()Gets grid (local) X coordinate of the given object.default intgetGridY()Gets grid (local) Y coordinate of the given object.default intgetRegionId()Gets the region id of the given object.TilegetTile()Gets tile of the object.default TileReferencegetTileReference()Gets tile reference of the given object.default intgetX()Gets X coordinate of the given object.default intgetY()Gets Y coordinate of the given object.default intgetZ()Gets Z coordinate of the given object.default inttileDistance(Tile tile)Distance (Chebyshev/Tchebychev) away from the given tile.default doublewalkingDistance(Tile tile)Walking distance based on pathfinding to the given tile.
-
-
-
Method Detail
-
getTile
Tile getTile()
Gets tile of the object.- Returns:
- the object tile.
-
distance
default double distance(Tile tile)
Distance (as the crow flies) away from the given tile.- Parameters:
tile- the destination tile.- Returns:
- return the distance from the given tile as a double.
-
tileDistance
default int tileDistance(Tile tile)
Distance (Chebyshev/Tchebychev) away from the given tile. This is roughly the amount of single steps/moves away the tile is. This differs fromdistance(Tile)because diagonals have the same cost.Note: this does not account for obstacles like
walkingDistance(Tile)does.- Parameters:
tile- the destination tile- Returns:
- the Chebyshev distance from the given tile
-
walkingDistance
default double walkingDistance(Tile tile)
Walking distance based on pathfinding to the given tile.This is a more expensive call than
distance(Tile), and should be used sparingly.- 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.
-
canReach
default boolean canReach()
Checks if this location is reachable by the local player without obstacles- Returns:
- true if it can, false otherwise
-
canReach
default boolean canReach(Tile tile)
Checks if this location is reachable by the provided tile without obstacles- Parameters:
tile- target tile- Returns:
- true if it can, false otherwise
-
getX
default int getX()
Gets X coordinate of the given object.- Returns:
- the X coordinate of the object.
-
getY
default int getY()
Gets Y coordinate of the given object.- Returns:
- the Y coordinate of the object.
-
getGridX
default int getGridX()
Gets grid (local) X coordinate of the given object.- Returns:
- the grid X coordinate of the object.
-
getGridY
default int getGridY()
Gets grid (local) Y coordinate of the given object.- Returns:
- the grid Y coordinate of the object.
-
getZ
default int getZ()
Gets Z coordinate of the given object.- Returns:
- the Z coordinate of the object.
-
getRegionId
default int getRegionId()
Gets the region id of the given object.
-
getTileReference
default TileReference getTileReference()
Gets tile reference of the given object.- Returns:
- the object tile reference.
-
-