Class EntityGuide

java.lang.Object
games.stendhal.server.core.pathfinder.EntityGuide

public class EntityGuide extends Object
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 Details

    • path

      public FixedPath path
      The path.
    • pathPosition

      public int pathPosition
      current position in the path.
  • Constructor Details

    • EntityGuide

      public EntityGuide()
  • Method Details

    • guideMe

      public void guideMe(GuidedEntity ge)
    • followPath

      public boolean followPath(GuidedEntity entity)
    • clearPath

      public void clearPath()
    • faceNext

      public void faceNext(GuidedEntity entity)
      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

      public Node nextNode()
      Get the next node on the path.
      Returns:
      The next Node, or null if there is no next node.
    • prevNode

      public Node prevNode()
      Get the previous node on the path.
      Returns:
      The previous Node.