Make trivia have a functional scoreboard
This commit is contained in:
@@ -0,0 +1,18 @@
|
||||
package wtf.beatrice.hidekobot.objects.comparators;
|
||||
|
||||
import wtf.beatrice.hidekobot.objects.TriviaScore;
|
||||
|
||||
import java.util.Comparator;
|
||||
import java.util.LinkedList;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* This class gets two trivia scores, and compares their score.
|
||||
*/
|
||||
public class TriviaScoreComparator implements Comparator<TriviaScore> {
|
||||
|
||||
@Override
|
||||
public int compare(TriviaScore o1, TriviaScore o2) {
|
||||
return Integer.compare(o2.getScore(), o1.getScore()); // inverted, because higher number should come first
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user