public class WorldPoint extends java.lang.Object implements simple.api.TileFlags, SimpleLocatable
Modifier and Type | Field and Description |
---|---|
static WorldPoint |
NIL |
int |
plane |
int |
x |
int |
y |
Constructor and Description |
---|
WorldPoint(int x,
int y) |
WorldPoint(int x,
int y,
int plane) |
Modifier and Type | Method and Description |
---|---|
WorldPoint |
derrive(int dx,
int dy) |
double |
distanceTo(WorldPoint point) |
double |
distanceTo2D(WorldPoint point) |
WorldPoint |
dx(int dx)
Offsets the x-axis coordinate by the passed value.
|
WorldPoint |
dy(int dy)
Offsets the y-axis coordinate by the passed value.
|
WorldPoint |
dz(int dz)
Offsets the plane by the passed value.
|
boolean |
equals(java.lang.Object obj) |
static WorldPoint |
fromLocal(SimpleClient client,
int x,
int y)
Gets the coordinate of the tile that contains the passed local point.
|
static WorldPoint |
fromLocal(SimpleClient client,
int x,
int y,
int plane)
Gets the coordinate of the tile that contains the passed local point.
|
static WorldPoint |
fromLocal(SimpleClient client,
LocalPoint local)
Gets the coordinate of the tile that contains the passed local point.
|
static WorldPoint |
fromRegion(int regionId,
int regionX,
int regionY,
int plane)
Converts the passed region ID and coordinates to a world coordinate
|
static WorldPoint |
fromScene(SimpleClient client,
int x,
int y,
int plane)
Converts the passed scene coordinates to a world space
|
WorldPoint |
getLocation()
Position in world of object
|
int |
getPlane() |
int |
getRegionID()
Gets the ID of the region containing this tile.
|
int |
getRegionX()
Gets the X-axis coordinate of the region coordinate
|
int |
getRegionY()
Gets the Y-axis coordinate of the region coordinate
|
int |
getX() |
int |
getY() |
int |
hashCode() |
boolean |
isInScene(SimpleClient client)
Checks whether this tile is located in the current scene.
|
static boolean |
isInScene(SimpleClient client,
int x,
int y)
Checks whether a tile is located in the current scene.
|
boolean |
isObjectTile(ClientContext ctx)
Determines if this tile is an object tile
|
boolean |
isReachable(ClientContext ctx)
Determines if this tile is reachable
|
boolean |
isReachable(ClientContext ctx,
boolean isObject)
Determines if this tile is reachable
|
boolean |
isWalkable(ClientContext ctx)
Determines if this tile is walkable
|
boolean |
onMap() |
java.lang.String |
toString() |
distanceTo, within, withinRange
public int x
public int y
public int plane
public static final WorldPoint NIL
public WorldPoint(int x, int y)
public WorldPoint(int x, int y, int plane)
public static WorldPoint fromLocal(SimpleClient client, LocalPoint local)
client
- the clientlocal
- the local coordinatepublic static WorldPoint fromLocal(SimpleClient client, int x, int y)
client
- the clientx
- the local x-axis coordinatey
- the local x-axis coordinatepublic static WorldPoint fromLocal(SimpleClient client, int x, int y, int plane)
client
- the clientx
- the local x-axis coordinatey
- the local x-axis coordinateplane
- the planepublic static WorldPoint fromScene(SimpleClient client, int x, int y, int plane)
public int getRegionID()
public static WorldPoint fromRegion(int regionId, int regionX, int regionY, int plane)
public int getRegionX()
public int getRegionY()
public WorldPoint dx(int dx)
dx
- the offsetpublic WorldPoint dy(int dy)
dy
- the offsetpublic WorldPoint dz(int dz)
dz
- the offsetpublic WorldPoint derrive(int dx, int dy)
public double distanceTo2D(WorldPoint point)
public double distanceTo(WorldPoint point)
public int getX()
public int getY()
public int getPlane()
public boolean isWalkable(ClientContext ctx)
true
if this tile is walkable, otherwise false
public boolean isReachable(ClientContext ctx, boolean isObject)
isObject
- whether this tile is an object tiletrue
if this tile is reachable, otherwise false
public boolean isReachable(ClientContext ctx)
true
if this tile is reachable, otherwise false
public boolean isObjectTile(ClientContext ctx)
true
if this tile is an object tile, otherwise false
public boolean onMap()
public boolean equals(java.lang.Object obj)
equals
in class java.lang.Object
public int hashCode()
hashCode
in class java.lang.Object
public java.lang.String toString()
toString
in class java.lang.Object
public WorldPoint getLocation()
SimpleLocatable
getLocation
in interface SimpleLocatable
public static boolean isInScene(SimpleClient client, int x, int y)
client
- the clientx
- the tiles x coordinatey
- the tiles y coordinatepublic boolean isInScene(SimpleClient client)
client
- the client