Last minute changes to get ready for DoD
#story[875]
This commit is contained in:
@@ -50,8 +50,8 @@ public abstract class XMLReader {
|
||||
|
||||
/**
|
||||
* Alternate constructor
|
||||
* @param xmlFile
|
||||
* @param isWholeFile
|
||||
* @param xmlFile File to be read
|
||||
* @param isWholeFile boolean value whether entire file is being passed
|
||||
*/
|
||||
public XMLReader(String xmlFile, Boolean isWholeFile) {
|
||||
|
||||
@@ -91,9 +91,9 @@ public abstract class XMLReader {
|
||||
|
||||
/**
|
||||
* Get the contents of the XML FILe.
|
||||
* @param document
|
||||
* @return
|
||||
* @throws TransformerException
|
||||
* @param document holds all xml information
|
||||
* @return String representation of document
|
||||
* @throws TransformerException when document is malformed, and cannot be turned into a string
|
||||
*/
|
||||
public static String getContents(Document document) throws TransformerException {
|
||||
DOMSource source = new DOMSource(document);
|
||||
|
||||
@@ -108,6 +108,7 @@ public class MockOutput implements Runnable
|
||||
* @param lon longitude of boat
|
||||
* @param heading heading of boat
|
||||
* @param speed speed of boat
|
||||
* @param time historical time of race
|
||||
*/
|
||||
public synchronized void parseBoatLocation(int sourceID, double lat, double lon, double heading, double speed, long time){
|
||||
|
||||
|
||||
@@ -374,26 +374,29 @@ public class Race implements Runnable {
|
||||
|
||||
} else {
|
||||
//Otherwise, the race is over!
|
||||
System.out.println("test");
|
||||
raceFinished.start();
|
||||
setRaceStatusEnum(RaceStatusEnum.FINISHED);
|
||||
this.stop();
|
||||
}
|
||||
|
||||
// Change wind direction
|
||||
changeWindDir();
|
||||
if (getNumberOfActiveBoats() != 0) {
|
||||
// Change wind direction
|
||||
changeWindDir();
|
||||
|
||||
//Parse the boat locations.
|
||||
parseBoatLocations();
|
||||
//Parse the boat locations.
|
||||
parseBoatLocations();
|
||||
|
||||
//Parse the marks.
|
||||
parseMarks();
|
||||
//Parse the marks.
|
||||
parseMarks();
|
||||
|
||||
//Parse the race status.
|
||||
parseRaceStatus();
|
||||
//Parse the race status.
|
||||
parseRaceStatus();
|
||||
|
||||
|
||||
//Update the last frame time.
|
||||
this.lastFrameTime = currentTime;
|
||||
//Update the last frame time.
|
||||
this.lastFrameTime = currentTime;
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
@@ -404,7 +407,7 @@ public class Race implements Runnable {
|
||||
int iters = 0;
|
||||
@Override
|
||||
public void handle(long now) {
|
||||
RaceStatus raceStatus = new RaceStatus(System.currentTimeMillis(), raceId, 4, startTime, 0, 2300, 2, null);
|
||||
RaceStatus raceStatus = new RaceStatus(System.currentTimeMillis(), raceId, 4, startTime, 0, 2300, 2, new ArrayList<>());
|
||||
mockOutput.parseRaceStatus(raceStatus);
|
||||
if (iters > 500){
|
||||
mockOutput.stop();
|
||||
@@ -625,10 +628,10 @@ public class Race implements Runnable {
|
||||
boat.setVMG(newVMG);
|
||||
}
|
||||
|
||||
|
||||
this.updateEstimatedTime(boat);
|
||||
//Check the boats position (update leg and stuff).
|
||||
this.checkPosition(boat, totalTimeElapsed);
|
||||
this.updateEstimatedTime(boat);
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
@@ -751,7 +754,6 @@ public class Race implements Runnable {
|
||||
boat.setTimeFinished(timeElapsed);
|
||||
boat.setCurrentSpeed(0);
|
||||
boat.setStatus(BoatStatusEnum.FINISHED);
|
||||
|
||||
} else if (doNotFinish()) {
|
||||
//Boat has pulled out of race.
|
||||
boat.setTimeFinished(timeElapsed);
|
||||
|
||||
Reference in New Issue
Block a user