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:
fjc40
2017-09-01 01:14:43 +12:00
parent 3176e76c8c
commit d0eebcdb2f
5 changed files with 120 additions and 47 deletions
@@ -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;
}
/**