mirror of
https://github.com/eclipse-sailing-analytics/sailing-analytics.git
synced 2026-10-20 19:20:04 +00:00
Merge branch 'master' into bug2059
This commit is contained in:
commit
0bef006d94
485 files changed
+7640
-3960
No files matched your search
+1
-19
@@ -13,30 +13,12 @@ public class ConfirmedFinishPositioningListFinder extends RaceLogAnalyzer<Compet
|
||||
|
||||
@Override
|
||||
protected CompetitorResults performAnalysis() {
|
||||
return performAnalysis(/* eventToIgnore */ null);
|
||||
}
|
||||
|
||||
private CompetitorResults performAnalysis(RaceLogFinishPositioningConfirmedEvent eventToIgnore) {
|
||||
for (RaceLogEvent event : getPassEventsDescending()) {
|
||||
if (event != eventToIgnore && event instanceof RaceLogFinishPositioningConfirmedEvent) {
|
||||
if (event instanceof RaceLogFinishPositioningConfirmedEvent) {
|
||||
RaceLogFinishPositioningConfirmedEvent finishPositioningEvent = (RaceLogFinishPositioningConfirmedEvent) event;
|
||||
return finishPositioningEvent.getPositionedCompetitorsIDsNamesMaxPointsReasons();
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* Same as {@link #analyze()}, only that if {@code event} is found in the log then it is ignored for this
|
||||
* analysis. This way, the method returns a result as it would have been without {@code event} in the
|
||||
* {@link RaceLog}. This can be useful, e.g., to determine the result prior to the last update.
|
||||
*/
|
||||
public CompetitorResults analyzeIgnoring(RaceLogFinishPositioningConfirmedEvent event) {
|
||||
log.lockForRead();
|
||||
try {
|
||||
return performAnalysis(event);
|
||||
} finally {
|
||||
log.unlockAfterRead();
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user