public interface Pathfindable
Modifier and Type | Method and Description |
---|---|
void |
clearIgnoredId()
Clear all ignored id.
|
void |
clearSharedPathIds()
Clear the list of id that share the same path.
|
int |
getLocationInTileX()
Get horizontal location in tile (location on map).
|
int |
getLocationInTileY()
Get vertical location in tile (location on map).
|
double |
getMoveX()
Get horizontal current speed.
|
double |
getMoveY()
Get vertical current speed.
|
double |
getSpeedX()
Get horizontal speed.
|
double |
getSpeedY()
Get vertical speed.
|
boolean |
isDestinationReached()
Check if has reached destination.
|
boolean |
isIgnoredId(java.lang.Integer id)
Check if id is ignored.
|
boolean |
isMoving()
Check is its moving.
|
boolean |
isPathAvailable(int dtx,
int dty)
Check if a path exists between entity and destination.
|
void |
setDestination(double extrp,
double x,
double y)
Move to specified destination only on call.
|
boolean |
setDestination(int dtx,
int dty)
Assign a specified location; will move automatically until reach it.
|
void |
setIgnoreId(java.lang.Integer id,
boolean state)
Ignore an id while searching pathfinding.
|
void |
setLocation(int dtx,
int dty)
Set specified location in tile.
|
void |
setSharedPathIds(java.util.Set<java.lang.Integer> ids)
Set the id list that shares the same path (this is used in grouped movement).
|
void |
setSpeed(double speedX,
double speedY)
Set move speed.
|
void |
stopMoves()
Stop any pathfinding movements.
|
void |
updateMoves(double extrp)
Update automatic moves if has.
|
void setDestination(double extrp, double x, double y)
extrp
- The extrapolation value.x
- The destination x.y
- The destination y.boolean setDestination(int dtx, int dty)
dtx
- The destination x (in tile map).dty
- The destination y (in tile map).true
if target found and valid, false
else.boolean isPathAvailable(int dtx, int dty)
dtx
- The destination x (in tile map).dty
- The destination y (in tile map).true
if path exists, false
else.void setLocation(int dtx, int dty)
dtx
- The location x in tile.dty
- The location y in tile.void setIgnoreId(java.lang.Integer id, boolean state)
id
- The id to ignore.state
- true
to ignore, false
else.boolean isIgnoredId(java.lang.Integer id)
id
- The id to check.true
if ignored, false
else.void clearIgnoredId()
void setSharedPathIds(java.util.Set<java.lang.Integer> ids)
ids
- The id list to add.void clearSharedPathIds()
void updateMoves(double extrp)
extrp
- The extrapolation value.void stopMoves()
void setSpeed(double speedX, double speedY)
speedX
- The horizontal speed.speedY
- The vertical speed.boolean isMoving()
true
if moving, false
else.boolean isDestinationReached()
true
if destination has been reached, false
else.double getSpeedX()
double getSpeedY()
double getMoveX()
double getMoveY()
int getLocationInTileX()
int getLocationInTileY()