|
|
|
@ -63,7 +63,9 @@ public class MockRace extends RaceState {
|
|
|
|
|
|
|
|
|
|
|
|
private ActiveObserverCommand activeObserverCommand;
|
|
|
|
private ActiveObserverCommand activeObserverCommand;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
private long racePreStartTime = Constants.RacePreStartTime;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
private long racePreparatoryTime = Constants.RacePreparatoryTime;
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
/**
|
|
|
|
* Constructs a race object with a given RaceDataSource, BoatDataSource, and RegattaDataSource and sends events to the given mockOutput.
|
|
|
|
* Constructs a race object with a given RaceDataSource, BoatDataSource, and RegattaDataSource and sends events to the given mockOutput.
|
|
|
|
@ -162,15 +164,15 @@ public class MockRace extends RaceState {
|
|
|
|
long timeToStart = - this.getRaceClock().getDurationMilli();
|
|
|
|
long timeToStart = - this.getRaceClock().getDurationMilli();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (timeToStart > Constants.RacePreStartTime) {
|
|
|
|
if (timeToStart > racePreStartTime) {
|
|
|
|
//Time > 3 minutes is the prestart period.
|
|
|
|
//Time > 3 minutes is the prestart period.
|
|
|
|
this.setRaceStatusEnum(RaceStatusEnum.PRESTART);
|
|
|
|
this.setRaceStatusEnum(RaceStatusEnum.PRESTART);
|
|
|
|
|
|
|
|
|
|
|
|
} else if ((timeToStart <= Constants.RacePreStartTime) && (timeToStart >= Constants.RacePreparatoryTime)) {
|
|
|
|
} else if ((timeToStart <= racePreStartTime) && (timeToStart >= racePreparatoryTime)) {
|
|
|
|
//Time between [1, 3] minutes is the warning period.
|
|
|
|
//Time between [1, 3] minutes is the warning period.
|
|
|
|
this.setRaceStatusEnum(RaceStatusEnum.WARNING);
|
|
|
|
this.setRaceStatusEnum(RaceStatusEnum.WARNING);
|
|
|
|
|
|
|
|
|
|
|
|
} else if ((timeToStart <= Constants.RacePreparatoryTime) && (timeToStart > 0)) {
|
|
|
|
} else if ((timeToStart <= racePreparatoryTime) && (timeToStart > 0)) {
|
|
|
|
//Time between (0, 1] minutes is the preparatory period.
|
|
|
|
//Time between (0, 1] minutes is the preparatory period.
|
|
|
|
this.setRaceStatusEnum(RaceStatusEnum.PREPARATORY);
|
|
|
|
this.setRaceStatusEnum(RaceStatusEnum.PREPARATORY);
|
|
|
|
|
|
|
|
|
|
|
|
@ -183,6 +185,13 @@ public class MockRace extends RaceState {
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public void setRacePreStartTime(long racePreStartTime) {
|
|
|
|
|
|
|
|
this.racePreStartTime = racePreStartTime;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public void setRacePreparatoryTime(long racePreparatoryTime) {
|
|
|
|
|
|
|
|
this.racePreparatoryTime = racePreparatoryTime;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
/**
|
|
|
|
* Sets the status of all boats in the race to RACING.
|
|
|
|
* Sets the status of all boats in the race to RACING.
|
|
|
|
|