|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface Pathfindable
Describe an object which can move on a tile path based map.
Method Summary | |
---|---|
boolean |
assignDestination(int tx,
int ty)
Assign a specified location; will move automaticaly until reach it. |
void |
clearIgnoredID()
Clear all ignored id. |
float |
getMoveX()
Get horizontal current speed. |
float |
getMoveY()
Get vertical current speed. |
float |
getSpeedX()
Get horizontal speed. |
float |
getSpeedY()
Get vertical speed. |
int |
getX()
Get horizontal location. |
int |
getXInTile()
Get horizontal location in tile (location on map). |
int |
getY()
Get vertical location. |
int |
getYInTile()
Get vertical location in tile (location on map). |
boolean |
hasReachedDestination()
Check if has reached destination. |
void |
ignoreID(int id,
boolean state)
Ignore an id while searching pathfinding. |
boolean |
isIgnoredID(int id)
Check if id is ignored. |
boolean |
isMoving()
Check is its moving. |
void |
manualMove(float dx,
float dy,
float extrp)
Move to specified destination only on call. |
boolean |
pathExists(int tx,
int ty)
Check if a path exists bewteen entity and destination. |
void |
place(int x,
int y)
Set specified location. |
void |
setArrived(boolean arrived)
Set arrived state (used to separate the arriving & arrived case). |
void |
setHackNSlash(boolean state)
Set specific case for hacknslash game (controling one unit). |
void |
setSpeed(float speedX,
float speedY)
Set move speed. |
void |
stopMoves()
Stop any pathfinding movements. |
void |
updateMoves(float extrp)
Update automatic moves if has. |
Method Detail |
---|
void manualMove(float dx, float dy, float extrp)
dx
- destination x.dy
- destination y.extrp
- extrapolation value.boolean assignDestination(int tx, int ty)
tx
- destination x (in tile map).ty
- destination y (in tile map).
boolean pathExists(int tx, int ty)
tx
- destination x (in tile map).ty
- destination y (in tile map).
void place(int x, int y)
x
- location x.y
- location y.void ignoreID(int id, boolean state)
id
- id to ignore.state
- true to ignore, false else.boolean isIgnoredID(int id)
id
- id to check.
void clearIgnoredID()
void updateMoves(float extrp)
extrp
- extrapolation value.void stopMoves()
void setArrived(boolean arrived)
arrived
- arrived state.void setSpeed(float speedX, float speedY)
speedX
- horizontal speed.speedY
- vertical speed.void setHackNSlash(boolean state)
state
- state.boolean isMoving()
boolean hasReachedDestination()
float getSpeedX()
float getSpeedY()
float getMoveX()
float getMoveY()
int getX()
int getY()
int getXInTile()
int getYInTile()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |