|
|
|
|
@ -34,20 +34,25 @@ public class Event {
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Send the initial race data and then begin race simulation
|
|
|
|
|
*/
|
|
|
|
|
public void start() {
|
|
|
|
|
|
|
|
|
|
System.out.println("Sending Regatta");
|
|
|
|
|
sendRegattaData();
|
|
|
|
|
System.out.println("Sending Race");
|
|
|
|
|
sendRaceData();
|
|
|
|
|
System.out.println("Sending Boat");
|
|
|
|
|
sendBoatData();
|
|
|
|
|
|
|
|
|
|
Race newRace = new Race(raceDataSource, 15, mockOutput);
|
|
|
|
|
new Thread((newRace)).start();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Send XML string of initial regatta data to the visualiser
|
|
|
|
|
* @throws InvalidRegattaDataException Invalid regatta
|
|
|
|
|
*/
|
|
|
|
|
public void sendRegattaData() throws InvalidRegattaDataException {
|
|
|
|
|
|
|
|
|
|
System.setOut(System.out);
|
|
|
|
|
@ -58,6 +63,10 @@ public class Event {
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Send XML string of initial race data to the visualiser
|
|
|
|
|
* @throws InvalidRaceDataException Invalid race
|
|
|
|
|
*/
|
|
|
|
|
public void sendRaceData() throws InvalidRaceDataException {
|
|
|
|
|
RaceData raceData = new RaceData(raceDataSource);
|
|
|
|
|
//Serialize race data to an XML as a string.
|
|
|
|
|
@ -66,6 +75,10 @@ public class Event {
|
|
|
|
|
mockOutput.parseXMLString(xmlString, 26);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Send XML string of initial boat data to the visualiser
|
|
|
|
|
* @throws InvalidBoatDataException Invalid boat
|
|
|
|
|
*/
|
|
|
|
|
public void sendBoatData() throws InvalidBoatDataException {
|
|
|
|
|
BoatData boatData = new BoatData(raceDataSource.getBoats());
|
|
|
|
|
//Serialize race data to an XML as a string.
|
|
|
|
|
|