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
Modifier and TypeFieldDescriptionThe path.int
current position in the path. -
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
void
faceNext(GuidedEntity entity)
Turn the entity face the next node on the path.boolean
followPath(GuidedEntity entity)
int
void
guideMe(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
, ornull
if there is no next node.
-
prevNode
Get the previous node on the path.- Returns:
- The previous
Node
.
-