|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.newdawn.asd.data.actions.MoveAction
org.newdawn.asd.data.actions.PathFollowAction
An action that will attempt to find a path to a particular location and then follow it.
| Field Summary | |
protected boolean |
considerActors
Consider actors when moving |
protected boolean |
movingToTarget
True if we've moving to the target |
protected Path |
path
The current path being followed |
protected boolean |
pathNeedsUpdate
True if the path needs updating |
protected int |
point
The point on the path that is being tended towards |
protected int |
startPoint
The first point on the path to use |
protected float |
targetx
The point we're moving towards |
protected float |
targety
The point we're moveint towards |
protected int |
tilNextPathFind
The time until we can cause a path find again |
| Fields inherited from class org.newdawn.asd.data.actions.MoveAction |
oldAction, x, y |
| Constructor Summary | |
PathFollowAction(float targetx,
float targety)
Create a new action |
|
| Method Summary | |
void |
act(Map map,
Actor actor,
int delta)
Invoke this action |
int |
getChecksum()
Retrieve a checksum for this action |
protected void |
handleBlocked(Actor actor,
float dx,
float dy)
Handler for when the actor is blocked from making any move in the right direction. |
protected void |
handleReachedTarget(Actor actor,
float dx,
float dy)
Handler for when the actor reaches the current target |
| Methods inherited from class org.newdawn.asd.data.actions.MoveAction |
handlePossibleBlocked, setTarget |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
protected int tilNextPathFind
protected Path path
protected float targetx
protected float targety
protected int point
protected boolean pathNeedsUpdate
protected boolean movingToTarget
protected boolean considerActors
protected int startPoint
| Constructor Detail |
public PathFollowAction(float targetx,
float targety)
targetx - The target we're hoping to get to eventuallytargety - The target we're hoping to get to eventually| Method Detail |
public void act(Map map,
Actor actor,
int delta)
Action
act in interface Actionact in class MoveActionAction.act(org.newdawn.asd.data.Map, org.newdawn.asd.data.Actor, int)public int getChecksum()
Action
getChecksum in interface ActiongetChecksum in class MoveActionAction.getChecksum()
protected void handleBlocked(Actor actor,
float dx,
float dy)
MoveAction
handleBlocked in class MoveActionactor - The actor that was movingdx - The ammount on the x-axis that was moveddy - The ammount on the y-axis that was movedMoveAction.handleBlocked(org.newdawn.asd.data.Actor, float, float)
protected void handleReachedTarget(Actor actor,
float dx,
float dy)
MoveAction
handleReachedTarget in class MoveActionactor - The actor that was being moveddx - The direction on the x-axis that was moved lastdy - The direction on the y-axis that was moved lastMoveAction.handleReachedTarget(org.newdawn.asd.data.Actor, float, float)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||