2011-09-25 06:17:32 +00:00
|
|
|
package me.StevenLawson.TotalFreedomMod;
|
|
|
|
|
|
|
|
import java.util.Comparator;
|
2011-09-26 02:24:54 +00:00
|
|
|
import org.bukkit.Location;
|
2011-09-25 06:17:32 +00:00
|
|
|
import org.bukkit.entity.Player;
|
|
|
|
|
|
|
|
public class RadarData implements Comparator<RadarData>
|
|
|
|
{
|
2011-10-02 04:18:52 +00:00
|
|
|
Player player;
|
|
|
|
double distance;
|
2011-09-26 02:24:54 +00:00
|
|
|
Location location;
|
2011-10-02 04:18:52 +00:00
|
|
|
|
|
|
|
public RadarData(Player inplayer, double indistance, Location inlocation)
|
|
|
|
{
|
|
|
|
this.player = inplayer;
|
|
|
|
this.distance = indistance;
|
2011-09-26 02:24:54 +00:00
|
|
|
this.location = inlocation;
|
2011-10-02 04:18:52 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
public RadarData()
|
|
|
|
{
|
|
|
|
}
|
2011-09-25 06:17:32 +00:00
|
|
|
|
2011-10-02 04:18:52 +00:00
|
|
|
@Override
|
|
|
|
public int compare(RadarData t1, RadarData t2)
|
|
|
|
{
|
|
|
|
if (t1.distance > t2.distance)
|
|
|
|
{
|
|
|
|
return 1;
|
|
|
|
}
|
|
|
|
else if (t1.distance < t2.distance)
|
|
|
|
{
|
|
|
|
return -1;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
}
|
2011-09-25 06:17:32 +00:00
|
|
|
}
|