Class LocalPath


  • public class LocalPath
    extends Path
    A path calculated using the current available collision region/scene data.
    • Constructor Detail

      • LocalPath

        public LocalPath​(Locatable end,
                         double precision,
                         APIContext ctx)
        Construct a new path.
        Parameters:
        end - the destination
        precision - how far off the destination this path is considered completed
        ctx - APIContext
      • LocalPath

        public LocalPath​(Locatable start,
                         Locatable end,
                         double precision,
                         APIContext ctx)
        Construct a new path.
        Parameters:
        start - the origin
        end - the destination
        precision - how far off the destination this path is considered completed
        ctx - APIContext
    • Method Detail

      • traverse

        public boolean traverse​(APIContext ctx)
        Description copied from class: Path
        Takes a step along this path if appropriate.
        Specified by:
        traverse in class Path
        Parameters:
        ctx - APIContext
        Returns:
        true if we are traversing this path, otherwise false. False can mean the destination is already reached or path destination is unreachable.
      • traverse

        public boolean traverse​(APIContext ctx,
                                boolean run)
        Description copied from class: Path
        Takes a step along this path if appropriate.
        Specified by:
        traverse in class Path
        Parameters:
        ctx - APIContext
        run - true to enable run
        Returns:
        true if we are traversing this path, otherwise false. False can mean the destination is already reached or path destination is unreachable.
      • validate

        public boolean validate​(APIContext ctx)
        Description copied from class: Path
        Checks whether or not this path can be traversed by the player. This will be the case when the player is near to one of its vertices, but not already standing on the end vertex.
        Specified by:
        validate in class Path
        Parameters:
        ctx - APIContext
        Returns:
        true if the player can walk along this path, false otherwise
      • getNext

        public Tile getNext​(APIContext ctx)
        Description copied from class: Path
        Gets the next available tile in this path.
        Specified by:
        getNext in class Path
        Parameters:
        ctx - APIContext
        Returns:
        the next tile or null
      • setStart

        public void setStart​(Tile start)
      • getStart

        public Tile getStart()
        Description copied from class: Path
        Gets the start tile of this path.
        Specified by:
        getStart in class Path
        Returns:
        the start tile
      • getEnd

        public Tile getEnd()
        Description copied from class: Path
        Gets the end tile of this path.
        Specified by:
        getEnd in class Path
        Returns:
        the end tile