public static class CollectionUtils.SortEntitiesByDistance extends Object implements Comparator<CombatEntityAPI>
Constructor and Description |
---|
SortEntitiesByDistance(Vector2f location) |
SortEntitiesByDistance(Vector2f location,
boolean includeRadius) |
Modifier and Type | Method and Description |
---|---|
int |
compare(CombatEntityAPI o1,
CombatEntityAPI o2)
Compares the distances of two
CombatEntityAPI s from a central
location. |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
comparing, comparing, comparingDouble, comparingInt, comparingLong, equals, naturalOrder, nullsFirst, nullsLast, reversed, reverseOrder, thenComparing, thenComparing, thenComparing, thenComparingDouble, thenComparingInt, thenComparingLong
public SortEntitiesByDistance(Vector2f location, boolean includeRadius)
location
- The central location to judge distance from.includeRadius
- Whether to include collision radius in the
check.public SortEntitiesByDistance(Vector2f location)
location
- The central location to judge distance from.public int compare(CombatEntityAPI o1, CombatEntityAPI o2)
CombatEntityAPI
s from a central
location.compare
in interface Comparator<CombatEntityAPI>
o1
- The first CombatEntityAPI
.o2
- The second CombatEntityAPI
.o1
and o2
from location
.