Class BresenhamPath

  • All Implemented Interfaces:
    Renderable

    public final class BresenhamPath
    extends CoordinatePath
    A path generated based on Bresenham's line algorithm. http://en.wikipedia.org/wiki/Bresenham's_line_algorithm It is a direct line between two points and doesn't navigate around objects These are best used in large open areas for basic walking.
    • Method Detail

      • buildTo

        @Nullable
        public static @Nullable BresenhamPath buildTo​(Locatable destination)
        Builds a BresenhamPath between the local player and the destination if possible.
        Parameters:
        destination - An entity with a location
        Returns:
        A BresenhamPath or null
      • buildBetween

        @Nullable
        public static @Nullable BresenhamPath buildBetween​(Locatable start,
                                                           Locatable destination)
        Builds a BresenhamPath between the start and the destination if possible. Both start and destination must be on the same plane.
        Parameters:
        start - An entity with a location to start the path generation from
        destination - An entity with a location to use as the destination
        Returns:
        A BresenhamPath or null
      • getVertices

        public java.util.List<Coordinate> getVertices()
        Description copied from class: Path
        Gets a list of the vertices in this path
        Specified by:
        getVertices in class CoordinatePath
        Returns:
        A List