mirror of
https://github.com/eclipse-sailing-analytics/sailing-analytics.git
synced 2026-10-23 12:33:53 +00:00
Merge branch 'bug3826'
This commit is contained in:
commit
f4cc6d6cc2
5 files changed
+18
-8
No files matched your search
+1
-1
@@ -31,7 +31,7 @@ public class LeaderboardDTO extends AbstractLeaderboardDTO implements Serializab
|
||||
private String id;
|
||||
|
||||
/**
|
||||
* The competitor list, ordered ascending by total rank
|
||||
* The competitor list, ordered ascending by total rank, suppressed competitors removed
|
||||
*/
|
||||
public List<CompetitorDTO> competitors;
|
||||
|
||||
|
||||
+6
@@ -610,11 +610,17 @@ public abstract class AbstractSimpleLeaderboardImpl implements Leaderboard, Race
|
||||
return result;
|
||||
}
|
||||
|
||||
/**
|
||||
* suppressed competitors are removed from the result
|
||||
*/
|
||||
@Override
|
||||
public List<Competitor> getCompetitorsFromBestToWorst(TimePoint timePoint) {
|
||||
return getCompetitorsFromBestToWorst(getRaceColumns(), timePoint);
|
||||
}
|
||||
|
||||
/**
|
||||
* suppressed competitors are removed from the result
|
||||
*/
|
||||
private List<Competitor> getCompetitorsFromBestToWorst(Iterable<RaceColumn> raceColumnsToConsider, TimePoint timePoint) {
|
||||
List<Competitor> result = new ArrayList<Competitor>();
|
||||
for (Competitor competitor : getCompetitors()) {
|
||||
|
||||
+5
-6
@@ -123,8 +123,10 @@ public class RaceCompetitorSet extends RaceCompetitorIdsAsStringWithMD5Hash {
|
||||
|
||||
/**
|
||||
* Tries to locate the competitors described by the IDs in {@link #idsAsStringOfCompetitorsParticipatingInRace} in
|
||||
* <code>competitors</code> and returns them in a set. If not all competitors can be found, <code>null</code> is
|
||||
* returned instead.
|
||||
* <code>competitors</code> and returns them in a set. The subset of competitors found this way is returned.
|
||||
* Note that due to the possibility of suppressing competitors it is possible that competitors are listed
|
||||
* as entries in the race but cannot be resolved in the leaderboard's competitors which does not contain
|
||||
* those being suppressed.
|
||||
*/
|
||||
private Set<CompetitorDTO> computeCompetitorsFromIDs(Iterable<CompetitorDTO> competitors) {
|
||||
Set<CompetitorDTO> result;
|
||||
@@ -138,10 +140,7 @@ public class RaceCompetitorSet extends RaceCompetitorIdsAsStringWithMD5Hash {
|
||||
result = new HashSet<>();
|
||||
for (String id : getIdsOfCompetitorsParticipatingInRaceAsStrings()) {
|
||||
CompetitorDTO c = competitorsByIdAsString.get(id);
|
||||
if (c == null) {
|
||||
result = null;
|
||||
break;
|
||||
} else {
|
||||
if (c != null) {
|
||||
result.add(c);
|
||||
}
|
||||
}
|
||||
|
||||
+1
-1
@@ -131,8 +131,8 @@ public class WinningLanesMode extends RaceBoardModeWithPerRaceCompetitors {
|
||||
if (!adjustedCompetitorSelection && getLeaderboardForSpecificTimePoint() != null && getCompetitorsInRace() != null) {
|
||||
stopReceivingCompetitorsInRace();
|
||||
adjustedCompetitorSelection = true;
|
||||
updateCompetitorSelection();
|
||||
}
|
||||
updateCompetitorSelection();
|
||||
}
|
||||
|
||||
}
|
||||
+5
@@ -15,5 +15,10 @@ public class RaceMapDataDTO implements IsSerializable {
|
||||
public LinkedHashMap<CompetitorDTO, QuickRankDTO> quickRanks;
|
||||
public LinkedHashMap<CompetitorDTO, Integer> competitorsInOrderOfWindwardDistanceTraveledWithOneBasedLegNumber;
|
||||
public long simulationResultVersion;
|
||||
|
||||
/**
|
||||
* The competitor IDs in their {@link Object#toString()} representation, for all competitors in the race, including those
|
||||
* that may be suppressed in a leaderboard.
|
||||
*/
|
||||
public HashSet<String> raceCompetitorIdsAsStrings;
|
||||
}
|
||||
Reference in new issue
Block a user