SourceIdAllocator now allocates from the BoatDataSource and RaceDataSource exposed by MockRace, instead of having its own source IDs. Can only allocate ids during PRESTART period.
RaceLogic now calls MockRace.initialiseBoats() after the prestart period has finished. MockRace create a VisualiserBoat when a source ID is allocated. MockOutput now sends updated XML messages during the race, instead of only at the start. #story[1188]
This commit is contained in:
@@ -188,7 +188,20 @@ public abstract class RaceState {
|
||||
* @return List of mark boats.
|
||||
*/
|
||||
public List<Mark> getMarks() {
|
||||
return new ArrayList<>(boatDataSource.getMarkerBoats().values());
|
||||
//BoatDataSource contains a collection of Marks, and RaceDataSource contains a collection of Compound marks (which contain marks). RaceDataSource is the "definitive" source of mark data.
|
||||
List<Mark> marks = new ArrayList<>(getCompoundMarks().size() * 2);
|
||||
|
||||
for (CompoundMark compoundMark : getCompoundMarks()) {
|
||||
if (compoundMark.getMark1() != null) {
|
||||
marks.add(compoundMark.getMark1());
|
||||
}
|
||||
|
||||
if (compoundMark.getMark2() != null) {
|
||||
marks.add(compoundMark.getMark2());
|
||||
}
|
||||
}
|
||||
|
||||
return marks;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user