mirror of
https://github.com/eclipse-sailing-analytics/sailing-analytics.git
synced 2026-10-08 21:30:57 +00:00
Added finder for the last wind fix in the race log
This commit is contained in:
1 parent
ae0fc9dcb5
commit
e056dba717
1 file changed
+28
+28
@@ -0,0 +1,28 @@
|
||||
package com.sap.sailing.domain.racelog.analyzing.impl;
|
||||
|
||||
import com.sap.sailing.domain.racelog.RaceLog;
|
||||
import com.sap.sailing.domain.racelog.RaceLogEvent;
|
||||
import com.sap.sailing.domain.racelog.RaceLogWindFixEvent;
|
||||
import com.sap.sailing.domain.tracking.Wind;
|
||||
|
||||
public class LastWindFixFinder extends RaceLogAnalyzer<Wind> {
|
||||
|
||||
public LastWindFixFinder(RaceLog raceLog) {
|
||||
super(raceLog);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected Wind performAnalyzation() {
|
||||
Wind lastWind = null;
|
||||
|
||||
for (RaceLogEvent event : getAllEvents()) {
|
||||
if (event instanceof RaceLogWindFixEvent) {
|
||||
RaceLogWindFixEvent windFixEvent = (RaceLogWindFixEvent) event;
|
||||
lastWind = windFixEvent.getWindFix();
|
||||
}
|
||||
}
|
||||
|
||||
return lastWind;
|
||||
}
|
||||
|
||||
}
|
||||
Reference in new issue
Block a user