org.lazywizard.lazylib
Class CollectionUtils.SortTokensByDistance
Object
CollectionUtils.SortTokensByDistance
- All Implemented Interfaces:
- Comparator<SectorEntityToken>
- Enclosing class:
- CollectionUtils
public static class CollectionUtils.SortTokensByDistance
- extends Object
- implements Comparator<SectorEntityToken>
A Comparator
that sorts SectorEntityToken
s by distance
the Vector2f
passed into the constructor.
- Since:
- 1.1
Method Summary |
int |
compare(SectorEntityToken o1,
SectorEntityToken o2)
Compares the distances of two SectorEntityToken s from a
central location. |
Methods inherited from class Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface Comparator |
equals |
CollectionUtils.SortTokensByDistance
public CollectionUtils.SortTokensByDistance(Vector2f location,
boolean includeRadius)
- Parameters:
location
- The central location to judge distance from.includeRadius
- Whether to include collision radius in the
check.
- Since:
- 1.6
CollectionUtils.SortTokensByDistance
public CollectionUtils.SortTokensByDistance(Vector2f location)
- Parameters:
location
- The central location to judge distance from.
- Since:
- 1.1
compare
public int compare(SectorEntityToken o1,
SectorEntityToken o2)
- Compares the distances of two
SectorEntityToken
s from a
central location.
- Specified by:
compare
in interface Comparator<SectorEntityToken>
- Parameters:
o1
- The first SectorEntityToken
.o2
- The second SectorEntityToken
.
- Returns:
- A comparison of the distances of
o1
and o2
from location
.
- Since:
- 1.1