mirror of
https://github.com/eclipse-sailing-analytics/sailing-analytics.git
synced 2026-10-16 17:21:00 +00:00
Refactor DefindeMarkEvent
This commit is contained in:
1 parent
2a9c674172
commit
4714b14b26
5 files changed
+18
-51
No files matched your search
+1
-2
@@ -33,7 +33,6 @@ import com.sap.sailing.domain.abstractlog.regatta.events.RegattaLogDeviceMarkMap
|
||||
import com.sap.sailing.domain.abstractlog.regatta.impl.BaseRegattaLogEventVisitor;
|
||||
import com.sap.sailing.domain.abstractlog.regatta.tracking.analyzing.impl.RegattaLogDeviceCompetitorMappingFinder;
|
||||
import com.sap.sailing.domain.abstractlog.regatta.tracking.analyzing.impl.RegattaLogDeviceMarkMappingFinder;
|
||||
import com.sap.sailing.domain.abstractlog.shared.events.DefineMarkEvent;
|
||||
import com.sap.sailing.domain.base.BoatClass;
|
||||
import com.sap.sailing.domain.base.Competitor;
|
||||
import com.sap.sailing.domain.base.ControlPoint;
|
||||
@@ -360,7 +359,7 @@ public class RaceLogRaceTracker implements RaceTracker, GPSFixReceivedListener {
|
||||
* {@link RaceLogDefineMarkEvent} is received, the existence of the track for that mark in the {@link TrackedRace}
|
||||
* has to be ensured, also ensuring that the mark will exist in the mark tracks map key set.
|
||||
*/
|
||||
private void onDefineMarkEvent(DefineMarkEvent<?> event) {
|
||||
private void onDefineMarkEvent(RegattaLogDefineMarkEvent event) {
|
||||
if (trackedRace != null) {
|
||||
trackedRace.getOrCreateTrack(event.getMark());
|
||||
}
|
||||
|
||||
+1
-4
@@ -1,15 +1,12 @@
|
||||
package com.sap.sailing.domain.abstractlog.regatta.events;
|
||||
|
||||
import com.sap.sailing.domain.abstractlog.Revokable;
|
||||
import com.sap.sailing.domain.abstractlog.regatta.RegattaLogEvent;
|
||||
import com.sap.sailing.domain.abstractlog.regatta.RegattaLogEventVisitor;
|
||||
import com.sap.sailing.domain.abstractlog.shared.events.DefineMarkEvent;
|
||||
import com.sap.sailing.domain.base.Mark;
|
||||
|
||||
/**
|
||||
* Defines a mark, that can then be used to build a course.
|
||||
*
|
||||
*/
|
||||
public interface RegattaLogDefineMarkEvent extends DefineMarkEvent<RegattaLogEventVisitor>, RegattaLogEvent, Revokable {
|
||||
public interface RegattaLogDefineMarkEvent extends RegattaLogEvent {
|
||||
Mark getMark();
|
||||
}
|
||||
+16
-3
@@ -3,23 +3,36 @@ package com.sap.sailing.domain.abstractlog.regatta.events.impl;
|
||||
import java.io.Serializable;
|
||||
|
||||
import com.sap.sailing.domain.abstractlog.AbstractLogEventAuthor;
|
||||
import com.sap.sailing.domain.abstractlog.impl.AbstractLogEventImpl;
|
||||
import com.sap.sailing.domain.abstractlog.regatta.RegattaLogEventVisitor;
|
||||
import com.sap.sailing.domain.abstractlog.regatta.events.RegattaLogDefineMarkEvent;
|
||||
import com.sap.sailing.domain.abstractlog.shared.events.impl.AbstractDefineMarkEventImpl;
|
||||
import com.sap.sailing.domain.base.Mark;
|
||||
import com.sap.sse.common.TimePoint;
|
||||
|
||||
public class RegattaLogDefineMarkEventImpl extends AbstractDefineMarkEventImpl<RegattaLogEventVisitor> implements RegattaLogDefineMarkEvent {
|
||||
public class RegattaLogDefineMarkEventImpl extends AbstractLogEventImpl<RegattaLogEventVisitor> implements RegattaLogDefineMarkEvent {
|
||||
private static final long serialVersionUID = -5114645637316367845L;
|
||||
|
||||
protected final Mark mark;
|
||||
|
||||
public RegattaLogDefineMarkEventImpl(TimePoint createdAt, AbstractLogEventAuthor author, TimePoint logicalTimePoint,
|
||||
Serializable pId, Mark mark) {
|
||||
super(createdAt, author, logicalTimePoint, pId, mark);
|
||||
super(createdAt, logicalTimePoint, author, pId);
|
||||
this.mark = mark;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void accept(RegattaLogEventVisitor visitor) {
|
||||
visitor.visit(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Mark getMark() {
|
||||
return mark;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getShortInfo() {
|
||||
return "mark: "+mark.toString();
|
||||
}
|
||||
|
||||
}
|
||||
-9
@@ -1,9 +0,0 @@
|
||||
package com.sap.sailing.domain.abstractlog.shared.events;
|
||||
|
||||
import com.sap.sailing.domain.abstractlog.AbstractLogEvent;
|
||||
import com.sap.sailing.domain.abstractlog.Revokable;
|
||||
import com.sap.sailing.domain.base.Mark;
|
||||
|
||||
public interface DefineMarkEvent<VisitorT> extends AbstractLogEvent<VisitorT>, Revokable {
|
||||
Mark getMark();
|
||||
}
|
||||
-33
@@ -1,33 +0,0 @@
|
||||
package com.sap.sailing.domain.abstractlog.shared.events.impl;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
import com.sap.sailing.domain.abstractlog.AbstractLogEventAuthor;
|
||||
import com.sap.sailing.domain.abstractlog.impl.AbstractLogEventImpl;
|
||||
import com.sap.sailing.domain.abstractlog.shared.events.DefineMarkEvent;
|
||||
import com.sap.sailing.domain.base.Mark;
|
||||
import com.sap.sse.common.TimePoint;
|
||||
|
||||
public abstract class AbstractDefineMarkEventImpl<VisitorT> extends AbstractLogEventImpl<VisitorT> implements
|
||||
DefineMarkEvent<VisitorT> {
|
||||
|
||||
private static final long serialVersionUID = 5865183507521850320L;
|
||||
|
||||
protected final Mark mark;
|
||||
|
||||
public AbstractDefineMarkEventImpl(TimePoint createdAt, AbstractLogEventAuthor author, TimePoint logicalTimePoint,
|
||||
Serializable pId, Mark mark) {
|
||||
super(createdAt, logicalTimePoint, author, pId);
|
||||
this.mark = mark;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Mark getMark() {
|
||||
return mark;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getShortInfo() {
|
||||
return "mark: "+mark.toString();
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user