LazyLib

org.lazywizard.lazylib
Class CollectionUtils.SortTokensByDistance

Object
  extended by CollectionUtils.SortTokensByDistance
All Implemented Interfaces:
Comparator<SectorEntityToken>
Enclosing class:
CollectionUtils

public static class CollectionUtils.SortTokensByDistance
extends Object
implements Comparator<SectorEntityToken>

A Comparator that sorts SectorEntityTokens by distance from a Vector2f.

Since:
1.1

Constructor Summary
CollectionUtils.SortTokensByDistance(Vector2f location)
           
CollectionUtils.SortTokensByDistance(Vector2f location, boolean includeRadius)
           
 
Method Summary
 int compare(SectorEntityToken o1, SectorEntityToken o2)
          Compares the distances of two SectorEntityTokens 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
 

Constructor Detail

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
Method Detail

compare

public int compare(SectorEntityToken o1,
                   SectorEntityToken o2)
Compares the distances of two SectorEntityTokens 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

LazyLib