Class DirectPathFinder

  • All Implemented Interfaces:
    IPathFinder

    public class DirectPathFinder
    extends Object
    implements IPathFinder
    Simple implementation without using obstacles.
    • Constructor Detail

      • DirectPathFinder

        public DirectPathFinder()
    • Method Detail

      • getSpacing

        public int getSpacing()
        It isn't used in this implementation. Always returns 0.
        Specified by:
        getSpacing in interface IPathFinder
        Returns:
        0
      • setSpacing

        public void setSpacing​(int spacing)
        It isn't used in this implementation
        Specified by:
        setSpacing in interface IPathFinder
        Parameters:
        spacing - the spacing to set
      • addObstacle

        public void addObstacle​(org.eclipse.draw2d.geometry.Rectangle rect)
        It isn't used in this implementation
        Specified by:
        addObstacle in interface IPathFinder
        Parameters:
        rect - the bounds of this obstacle
      • removeObstacle

        public void removeObstacle​(org.eclipse.draw2d.geometry.Rectangle rect)
        It isn't used in this implementation
        Specified by:
        removeObstacle in interface IPathFinder
        Parameters:
        rect - the bounds of the obstacle to remove
      • updateObstacle

        public void updateObstacle​(org.eclipse.draw2d.geometry.Rectangle oldBounds,
                                   org.eclipse.draw2d.geometry.Rectangle newBounds)
        It isn't used in this implementation
        Specified by:
        updateObstacle in interface IPathFinder
        Parameters:
        oldBounds - the old bounds(used to find the obstacle)
        newBounds - the new bounds
      • find

        public RoutePath find​(Position start,
                              Position end,
                              boolean strict)
        Returns a path containing start and end points of the positions.
        Specified by:
        find in interface IPathFinder
        Parameters:
        start - the start position
        end - the end position
        strict - the flag
        Returns:
        a path containing start and end points of the positions
        See Also:
        RoutePath