MassiveCore Change

This commit is contained in:
Olof Larsson 2015-11-08 19:07:13 +01:00
parent 1c6f3f28d1
commit 352db64850

View File

@ -1,13 +1,11 @@
package com.massivecraft.factions.cmd.type;
import java.util.Collection;
import java.util.Comparator;
import com.massivecraft.factions.PlayerInactivityComparator;
import com.massivecraft.factions.PlayerPowerComparator;
import com.massivecraft.factions.PlayerRoleComparator;
import com.massivecraft.factions.entity.MPlayer;
import com.massivecraft.massivecore.collections.MassiveList;
import com.massivecraft.massivecore.command.type.TypeAbstractChoice;
public class TypeSortMPlayer extends TypeAbstractChoice<Comparator<MPlayer>>
@ -18,6 +16,14 @@ public class TypeSortMPlayer extends TypeAbstractChoice<Comparator<MPlayer>>
private static TypeSortMPlayer i = new TypeSortMPlayer();
public static TypeSortMPlayer get() { return i; }
public TypeSortMPlayer()
{
this.setAll(
PlayerRoleComparator.get(),
PlayerPowerComparator.get(),
PlayerInactivityComparator.get()
);
}
// -------------------------------------------- //
// OVERRIDE
@ -28,18 +34,5 @@ public class TypeSortMPlayer extends TypeAbstractChoice<Comparator<MPlayer>>
{
return "player sorter";
}
@SuppressWarnings("unchecked")
@Override
public Collection<Comparator<MPlayer>> getAll()
{
return new MassiveList<Comparator<MPlayer>>(
PlayerRoleComparator.get(),
PlayerPowerComparator.get(),
PlayerInactivityComparator.get()
);
}
}