mirror of
https://github.com/eclipse-sailing-analytics/sailing-analytics.git
synced 2026-10-11 23:00:59 +00:00
for bug 1946, started to implement the HighPointWinnerGetsSixLastGetsOneOthersAreInterpolated scoring scheme for the Bundesliga 2014
This commit is contained in:
1 parent
929353267f
commit
d7fc9d8056
7 files changed
+40
-2
No files matched your search
+2
-2
@@ -1,6 +1,6 @@
|
||||
package com.sap.sailing.domain.common;
|
||||
|
||||
public enum ScoringSchemeType {
|
||||
LOW_POINT, HIGH_POINT, HIGH_POINT_ESS_OVERALL, HIGH_POINT_LAST_BREAKS_TIE,
|
||||
HIGH_POINT_FIRST_GETS_TEN, HIGH_POINT_FIRST_GETS_ONE, LOW_POINT_WINNER_GETS_ZERO
|
||||
LOW_POINT, HIGH_POINT, HIGH_POINT_ESS_OVERALL, HIGH_POINT_LAST_BREAKS_TIE, HIGH_POINT_FIRST_GETS_TEN,
|
||||
HIGH_POINT_FIRST_GETS_ONE, LOW_POINT_WINNER_GETS_ZERO, HIGH_POINT_WINNER_GETS_SIX_LAST_GETS_ONE_OTHERS_ARE_INTERPOLATED
|
||||
}
|
||||
+3
@@ -35,6 +35,7 @@ import com.sap.sailing.domain.leaderboard.impl.HighPointExtremeSailingSeriesOver
|
||||
import com.sap.sailing.domain.leaderboard.impl.HighPointFirstGets10LastBreaksTie;
|
||||
import com.sap.sailing.domain.leaderboard.impl.HighPointFirstGets1LastBreaksTie;
|
||||
import com.sap.sailing.domain.leaderboard.impl.HighPointLastBreaksTie;
|
||||
import com.sap.sailing.domain.leaderboard.impl.HighPointWinnerGetsSixLastGetsOneOthersAreInterpolated;
|
||||
import com.sap.sailing.domain.leaderboard.impl.LowPoint;
|
||||
import com.sap.sailing.domain.leaderboard.impl.LowPointWinnerGetsZero;
|
||||
import com.sap.sailing.domain.tracking.GPSFix;
|
||||
@@ -86,6 +87,8 @@ public class DomainFactoryImpl extends SharedDomainFactoryImpl implements Domain
|
||||
return new HighPointFirstGets10LastBreaksTie();
|
||||
case LOW_POINT_WINNER_GETS_ZERO:
|
||||
return new LowPointWinnerGetsZero();
|
||||
case HIGH_POINT_WINNER_GETS_SIX_LAST_GETS_ONE_OTHERS_ARE_INTERPOLATED:
|
||||
return new HighPointWinnerGetsSixLastGetsOneOthersAreInterpolated();
|
||||
}
|
||||
throw new RuntimeException("Unknown scoring scheme type "+scoringSchemeType.name());
|
||||
}
|
||||
|
||||
+30
@@ -0,0 +1,30 @@
|
||||
package com.sap.sailing.domain.leaderboard.impl;
|
||||
|
||||
import java.util.concurrent.Callable;
|
||||
|
||||
import com.sap.sailing.domain.base.Competitor;
|
||||
import com.sap.sailing.domain.base.RaceColumn;
|
||||
import com.sap.sailing.domain.common.ScoringSchemeType;
|
||||
import com.sap.sailing.domain.leaderboard.NumberOfCompetitorsInLeaderboardFetcher;
|
||||
|
||||
public class HighPointWinnerGetsSixLastGetsOneOthersAreInterpolated extends HighPointFirstGetsFixedScore {
|
||||
private static final long serialVersionUID = -4116295702464748719L;
|
||||
|
||||
public HighPointWinnerGetsSixLastGetsOneOthersAreInterpolated() {
|
||||
super(/* scoreForRaceWinner */ 6);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Double getScoreForRank(RaceColumn raceColumn, Competitor competitor, int rank,
|
||||
Callable<Integer> numberOfCompetitorsInRaceFetcher,
|
||||
NumberOfCompetitorsInLeaderboardFetcher numberOfCompetitorsInLeaderboardFetcher) {
|
||||
// TODO: find out what the rules for interpolation shall be and implement accordingly
|
||||
return super.getScoreForRank(raceColumn, competitor, rank, numberOfCompetitorsInRaceFetcher,
|
||||
numberOfCompetitorsInLeaderboardFetcher);
|
||||
}
|
||||
|
||||
@Override
|
||||
public ScoringSchemeType getType() {
|
||||
return ScoringSchemeType.HIGH_POINT_WINNER_GETS_SIX_LAST_GETS_ONE_OTHERS_ARE_INTERPOLATED;
|
||||
}
|
||||
}
|
||||
+1
@@ -373,6 +373,7 @@ public interface StringMessages extends Messages {
|
||||
String scoringSchemeLowPointSystem();
|
||||
String scoringSchemeHighPointSystem();
|
||||
String scoringSchemeLowPointWinnerGetsZero();
|
||||
String scoringSchemeWinnerGetsSixLastGetsOneOthersAreInterpolated();
|
||||
String scoringSystem();
|
||||
String createFlexibleLeaderboard();
|
||||
String createRegattaLeaderboard();
|
||||
|
||||
+1
@@ -402,6 +402,7 @@ scoringSchemeHighPointSystem=High Point System
|
||||
scoringSchemeHighPointEssOverall=High Point System ESS Overall
|
||||
scoringSchemeHighPointLastBreaksTie=High Point System, Last Race Breaks Tie
|
||||
scoringSchemeLowPointWinnerGetsZero=Low Point System, Winner Gets Zero
|
||||
scoringSchemeWinnerGetsSixLastGetsOneOthersAreInterpolated=High Point System, Winner 6, Last 1, Others Interpolated
|
||||
scoringSystem=Scoring system
|
||||
createFlexibleLeaderboard=Create flexible leaderboard
|
||||
createRegattaLeaderboard=Create regatta leaderboard
|
||||
|
||||
+1
@@ -403,6 +403,7 @@ scoringSchemeHighPointSystem=High Point System
|
||||
scoringSchemeHighPointEssOverall=High Point System ESS Gesamtwertung
|
||||
scoringSchemeHighPointLastBreaksTie=High Point System, letztes Rennen entscheidet bei Gleichstand
|
||||
scoringSchemeLowPointWinnerGetsZero=Low Point System, Gewinner erhält 0 Punkte
|
||||
scoringSchemeWinnerGetsSixLastGetsOneOthersAreInterpolated=High Point System, Gewinner 6, Letzter 1, alle anderen interpoliert
|
||||
scoringSystem=Bepunktungssystem
|
||||
createFlexibleLeaderboard=Flexible Rangliste anlegen
|
||||
createRegattaLeaderboard=Rangliste für Regatta anlegen
|
||||
|
||||
+2
@@ -20,6 +20,8 @@ public class ScoringSchemeTypeFormatter {
|
||||
return stringMessages.scoringSchemeHighPointFirstGetsTen();
|
||||
case LOW_POINT_WINNER_GETS_ZERO:
|
||||
return stringMessages.scoringSchemeLowPointWinnerGetsZero();
|
||||
case HIGH_POINT_WINNER_GETS_SIX_LAST_GETS_ONE_OTHERS_ARE_INTERPOLATED:
|
||||
return stringMessages.scoringSchemeWinnerGetsSixLastGetsOneOthersAreInterpolated();
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user