mirror of
https://github.com/eclipse-sailing-analytics/sailing-analytics.git
synced 2026-10-27 14:27:15 +00:00
First implementation to map fginished races
This commit is contained in:
1 parent
d1258ee017
commit
ceda7ef1a0
2 files changed
+18
No files matched your search
+13
@@ -295,6 +295,19 @@ public class RaceContext {
|
||||
return null;
|
||||
}
|
||||
|
||||
public RaceListRaceDTO getFinishedRaceOrNull() {
|
||||
// a race is of 'public interest' of a race is a combination of it's 'live' state
|
||||
// and special flags states indicating how the postponed/canceled races will be continued
|
||||
if(getLiveRaceViewState() == RaceViewState.FINISHED) {
|
||||
// the start time is always given for live races
|
||||
RaceListRaceDTO liveRaceDTO = new RaceListRaceDTO(getRegattaName(), raceColumn.getName());
|
||||
fillRaceData(liveRaceDTO);
|
||||
|
||||
return liveRaceDTO;
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
private void fillRaceData(RaceMetadataDTO dto) {
|
||||
dto.setViewState(getLiveRaceViewState());
|
||||
dto.setRegattaDisplayName(getRegattaDisplayName());
|
||||
|
||||
+5
@@ -12,6 +12,11 @@ public class RaceListDataCalculator implements RaceCallback {
|
||||
@Override
|
||||
public void doForRace(RaceContext context) {
|
||||
context.addLiveRace(result.getLiveRaces());
|
||||
|
||||
RaceListRaceDTO finishedRace = context.getFinishedRaceOrNull();
|
||||
if(finishedRace != null) {
|
||||
result.addRace(finishedRace);
|
||||
}
|
||||
}
|
||||
|
||||
public ResultWithTTL<RaceListViewDTO> getResult() {
|
||||
|
||||
Reference in new issue
Block a user