Class Distance
- java.lang.Object
-
- com.runemate.game.api.hybrid.util.calculations.Distance
-
public final class Distance extends java.lang.Object
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
Distance.Algorithm
A variety of algorithms used for calculating distances.
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static double
between(Locatable start, Locatable destination)
static double
between(Locatable start, Locatable destination, Distance.Algorithm algorithm)
Calculates the distance between the start and destination using the specified algorithm.static double
between(Locatable start, Locatable destination, Distance.Algorithm algorithm, java.util.Map<java.lang.String,java.lang.Object> cache)
Calculates the distance between the start and destination center coordinates using the specified algorithm.static double
between(Locatable start, Locatable destination, java.util.Map<java.lang.String,java.lang.Object> cache)
static double
between(Coordinate start, Coordinate destination)
static double
between(Coordinate start, Coordinate destination, Distance.Algorithm algorithm)
Calculates the distance between the start and destination using the specified algorithm.static Distance.Algorithm
getDefaultAlgorithm()
static double
to(Locatable destination)
static double
to(Locatable destination, Distance.Algorithm algorithm)
static double
to(Locatable destination, Distance.Algorithm algorithm, java.util.Map<java.lang.String,java.lang.Object> cache)
Calculates the distance between the local player and the destination using the specified algorithm.static double
to(Locatable destination, java.util.Map<java.lang.String,java.lang.Object> cache)
-
-
-
Method Detail
-
getDefaultAlgorithm
public static Distance.Algorithm getDefaultAlgorithm()
-
to
public static double to(Locatable destination)
-
to
public static double to(Locatable destination, Distance.Algorithm algorithm)
-
to
public static double to(Locatable destination, java.util.Map<java.lang.String,java.lang.Object> cache)
-
to
public static double to(Locatable destination, Distance.Algorithm algorithm, java.util.Map<java.lang.String,java.lang.Object> cache)
Calculates the distance between the local player and the destination using the specified algorithm.- Returns:
- The calculated value or -1
-
between
public static double between(Locatable start, Locatable destination, java.util.Map<java.lang.String,java.lang.Object> cache)
-
between
public static double between(Locatable start, Locatable destination, Distance.Algorithm algorithm)
Calculates the distance between the start and destination using the specified algorithm.- Returns:
- The calculated value or Double.POSITIVE_INFINITY if the Locatables are on the same plane.
-
between
public static double between(Locatable start, Locatable destination, Distance.Algorithm algorithm, java.util.Map<java.lang.String,java.lang.Object> cache)
Calculates the distance between the start and destination center coordinates using the specified algorithm.- Returns:
- The calculated value or Double.POSITIVE_INFINITY if the Locatables are on the same plane.
-
between
public static double between(Coordinate start, Coordinate destination)
-
between
public static double between(Coordinate start, Coordinate destination, Distance.Algorithm algorithm)
Calculates the distance between the start and destination using the specified algorithm.- Returns:
- The calculated value or Double.POSITIVE_INFINITY if the Locatables are on the same plane.
-
-