LazyLib

org.lazywizard.lazylib
Class CollectionUtils.SortTokensByDistance

java.lang.Object
  extended by org.lazywizard.lazylib.CollectionUtils.SortTokensByDistance
All Implemented Interfaces:
java.util.Comparator<com.fs.starfarer.api.campaign.SectorEntityToken>
Enclosing class:
CollectionUtils

public static class CollectionUtils.SortTokensByDistance
extends java.lang.Object
implements java.util.Comparator<com.fs.starfarer.api.campaign.SectorEntityToken>

A Comparator that sorts SectorEntityTokens by distance from a Vector2f.

Since:
1.1

Constructor Summary
CollectionUtils.SortTokensByDistance(org.lwjgl.util.vector.Vector2f location)
           
 
Method Summary
 int compare(com.fs.starfarer.api.campaign.SectorEntityToken o1, com.fs.starfarer.api.campaign.SectorEntityToken o2)
          Compares the distances of two SectorEntityTokens from a central location.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface java.util.Comparator
equals
 

Constructor Detail

CollectionUtils.SortTokensByDistance

public CollectionUtils.SortTokensByDistance(org.lwjgl.util.vector.Vector2f location)
Parameters:
location - The central location to judge distance from.
Since:
1.1
Method Detail

compare

public int compare(com.fs.starfarer.api.campaign.SectorEntityToken o1,
                   com.fs.starfarer.api.campaign.SectorEntityToken o2)
Compares the distances of two SectorEntityTokens from a central location.

Specified by:
compare in interface java.util.Comparator<com.fs.starfarer.api.campaign.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