Class EntityGuide
java.lang.Object
games.stendhal.server.core.pathfinder.EntityGuide
the guide dog of an Entity. this class takes the goals where an Entity shall
move to via a path. and keeps control over the steps.
The guided Entity can always change the destination. Like a blind person can
tell its guide dog.
- Author:
- astrid
-
Field Summary
FieldsModifier and TypeFieldDescriptionThe path.intcurrent position in the path. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidvoidfaceNext(GuidedEntity entity) Turn the entity face the next node on the path.booleanfollowPath(GuidedEntity entity) intvoidguideMe(GuidedEntity ge) nextNode()Get the next node on the path.prevNode()Get the previous node on the path.
-
Field Details
-
path
The path. -
pathPosition
public int pathPositioncurrent position in the path.
-
-
Constructor Details
-
EntityGuide
public EntityGuide()
-
-
Method Details
-
guideMe
-
followPath
-
clearPath
public void clearPath() -
faceNext
Turn the entity face the next node on the path. If the entity following the path just reached the last node, stop the entity.- Parameters:
entity- the guided entity
-
getPreviousPosition
public int getPreviousPosition()- Returns:
- Entity's last position
-
nextNode
Get the next node on the path.- Returns:
- The next
Node, ornullif there is no next node.
-
prevNode
Get the previous node on the path.- Returns:
- The previous
Node.
-