fixed comparator which fixed thr first trivial leaderboard scoring test

This commit is contained in:
Axel Uhl committed 2012-05-24 13:58:06 +02:00
1 parent 5a2107934c
commit 2b2e2486bf
2 files changed
+4 -3

No files matched your search

@@ -361,8 +361,6 @@ public abstract class AbstractLeaderboardImpl implements Leaderboard {
result.add(competitor);
}
Collections.sort(result, getTotalRankComparator(timePoint));
// TODO issues:
// - we don't know which competitors compete in those fleets for which we have no tracked race in a column
return result;
}
@@ -75,7 +75,7 @@ public class LeaderboardTotalRankComparator implements Comparator<Competitor> {
o1Scores.add(o1Score);
o1ScoreSum += o1Score;
}
final int o2Score = getLeaderboard().getTotalPoints(o1, raceColumn, timePoint);
final int o2Score = getLeaderboard().getTotalPoints(o2, raceColumn, timePoint);
if (o2Score != 0) {
o2Scores.add(o2Score);
o2ScoreSum += o2Score;
@@ -86,6 +86,9 @@ public class LeaderboardTotalRankComparator implements Comparator<Competitor> {
if (preemptiveColumnResult == 0) {
preemptiveColumnResult = compareByFleet(raceColumn, o1, o2);
}
if (preemptiveColumnResult != 0) {
return preemptiveColumnResult;
}
}
// now count the races in which they scored; if they scored in a different number of races, prefer the competitor
// who scored more often; otherwise, prefer the competitor who has a better score sum; if score sums are equal, break