LazyLib

org.lazywizard.lazylib
Class CollectionUtils.SortObjectivesByDistance

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

public static class CollectionUtils.SortObjectivesByDistance
extends java.lang.Object
implements java.util.Comparator<com.fs.starfarer.api.combat.BattleObjectiveAPI>

A Comparator that sorts BattleObjectiveAPIs by distance from a Vector2f.

Since:
1.1

Constructor Summary
CollectionUtils.SortObjectivesByDistance(org.lwjgl.util.vector.Vector2f location)
           
 
Method Summary
 int compare(com.fs.starfarer.api.combat.BattleObjectiveAPI o1, com.fs.starfarer.api.combat.BattleObjectiveAPI o2)
          Compares the distances of two BattleObjectiveAPIs 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.SortObjectivesByDistance

public CollectionUtils.SortObjectivesByDistance(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.combat.BattleObjectiveAPI o1,
                   com.fs.starfarer.api.combat.BattleObjectiveAPI o2)
Compares the distances of two BattleObjectiveAPIs from a central location.

Specified by:
compare in interface java.util.Comparator<com.fs.starfarer.api.combat.BattleObjectiveAPI>
Parameters:
o1 - The first BattleObjectiveAPI.
o2 - The second BattleObjectiveAPI.
Returns:
A comparison of the distances of o1 and o2 from location.
Since:
1.1

LazyLib