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; package com.massivecraft.factions.cmd.type;
import java.util.Collection;
import java.util.Comparator; import java.util.Comparator;
import com.massivecraft.factions.PlayerInactivityComparator; import com.massivecraft.factions.PlayerInactivityComparator;
import com.massivecraft.factions.PlayerPowerComparator; import com.massivecraft.factions.PlayerPowerComparator;
import com.massivecraft.factions.PlayerRoleComparator; import com.massivecraft.factions.PlayerRoleComparator;
import com.massivecraft.factions.entity.MPlayer; import com.massivecraft.factions.entity.MPlayer;
import com.massivecraft.massivecore.collections.MassiveList;
import com.massivecraft.massivecore.command.type.TypeAbstractChoice; import com.massivecraft.massivecore.command.type.TypeAbstractChoice;
public class TypeSortMPlayer extends TypeAbstractChoice<Comparator<MPlayer>> public class TypeSortMPlayer extends TypeAbstractChoice<Comparator<MPlayer>>
@ -18,6 +16,14 @@ public class TypeSortMPlayer extends TypeAbstractChoice<Comparator<MPlayer>>
private static TypeSortMPlayer i = new TypeSortMPlayer(); private static TypeSortMPlayer i = new TypeSortMPlayer();
public static TypeSortMPlayer get() { return i; } public static TypeSortMPlayer get() { return i; }
public TypeSortMPlayer()
{
this.setAll(
PlayerRoleComparator.get(),
PlayerPowerComparator.get(),
PlayerInactivityComparator.get()
);
}
// -------------------------------------------- // // -------------------------------------------- //
// OVERRIDE // OVERRIDE
@ -29,17 +35,4 @@ public class TypeSortMPlayer extends TypeAbstractChoice<Comparator<MPlayer>>
return "player sorter"; return "player sorter";
} }
@SuppressWarnings("unchecked")
@Override
public Collection<Comparator<MPlayer>> getAll()
{
return new MassiveList<Comparator<MPlayer>>(
PlayerRoleComparator.get(),
PlayerPowerComparator.get(),
PlayerInactivityComparator.get()
);
}
} }