Package model.util
Class PathFinder
java.lang.Object
model.util.PathFinder
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiondouble
euclideanDistance
(Buildable start, Buildable goal) Calculates the euclidean distance between two buildableint
manhattanDistance
(Buildable start, Buildable goal) Calculates the manhattan distance between two buildabledouble
squareDistance
(Buildable start, Buildable goal) Calculates max difference between two buildable
-
Constructor Details
-
PathFinder
-
-
Method Details
-
euclideanDistance
Calculates the euclidean distance between two buildable- Parameters:
start
- the starting buildablegoal
- the goal buildable- Returns:
- the euclidean distance
- Throws:
NullPointerException
- if one of the parameter is null.
-
squareDistance
Calculates max difference between two buildable- Parameters:
start
- the starting buildablegoal
- the goal buildable- Returns:
- the euclidean distance
- Throws:
NullPointerException
- if one of the parameter is null.
-
manhattanDistance
Calculates the manhattan distance between two buildable- Parameters:
start
- the starting buildablegoal
- the goal buildable- Returns:
- the manhattan distance
-