Fixed Tutorial not being able to run #story[1185]

This commit is contained in:
Fan-Wu Yang
2017-09-13 14:29:48 +12:00
parent d1f74dec3a
commit e87173ee39
2 changed files with 30 additions and 11 deletions
@@ -107,9 +107,10 @@ public class Event {
try {
//this.raceXML = RaceXMLCreator.alterRaceToWind(raceXMLFile, 90);
this.raceXML = XMLReader.readXMLFileToString(raceXMLFile, StandardCharsets.UTF_8);
this.raceXML = Event.setRaceXMLAtCurrentTimeToNow(XMLReader.readXMLFileToString(raceXMLFile, StandardCharsets.UTF_8));
if(mapIndex==4){
this.raceXML = Event.setRaceXMLAtCurrentTimeToNow(XMLReader.readXMLFileToString(raceXMLFile, StandardCharsets.UTF_8), 1000, 5000);
} else {
this.raceXML = Event.setRaceXMLAtCurrentTimeToNow(XMLReader.readXMLFileToString(raceXMLFile, StandardCharsets.UTF_8));
}
this.boatXML = XMLReader.readXMLFileToString(boatsXMLFile, StandardCharsets.UTF_8);
this.regattaXML = XMLReader.readXMLFileToString(regattaXMLFile, StandardCharsets.UTF_8);
@@ -144,14 +145,23 @@ public class Event {
Bearing.fromDegrees(225),
12
);
MockRace mockRace = new MockRace(
boatDataSource,
raceDataSource,
regattaDataSource,
this.boatPolars,
Constants.RaceTimeScale,
windGenerator );
if(mapIndex==4){
mockRace.setRacePreStartTime(1000);
mockRace.setRacePreparatoryTime(5000);
}
RaceLogic newRace = new RaceLogic(
new MockRace(
boatDataSource,
raceDataSource,
regattaDataSource,
this.boatPolars,
Constants.RaceTimeScale,
windGenerator ),
mockRace,
this.latestMessages,
this.compositeCommand);