Moved speed conversion to BoatMessage class

#story[778]
This commit is contained in:
Erika Savell
2017-05-03 21:01:30 +12:00
parent 7c59632c41
commit b9901a252a
3 changed files with 4 additions and 8 deletions
+1 -3
View File
@@ -88,9 +88,7 @@ public class MockOutput implements Runnable
*/
public synchronized void parseBoatLocation(int sourceID, double lat, double lon, double heading, double speed){
int newSpeed = (int) Math.round((speed * Constants.KnotsToMetersPerSecondConversionFactor * 1000));
BoatLocationMessage boatLocationMessage = new BoatLocationMessage(sourceID, lat, lon, boatLocationSequenceNumber, heading, newSpeed);
BoatLocationMessage boatLocationMessage = new BoatLocationMessage(sourceID, lat, lon, boatLocationSequenceNumber, heading, speed);
//iterates the sequence number
boatLocationSequenceNumber++;
+1 -3
View File
@@ -32,7 +32,7 @@ public class Race implements Runnable {
protected int boatsFinished = 0;
protected long totalTimeElapsed;
protected int scaleFactor;
protected int PRERACE_TIME = 180000; //time in milliseconds to pause during pre-race. At the moment, 3 minutes
protected int PRERACE_TIME = 180; //time in milliseconds to pause during pre-race. At the moment, 3 minutes
protected boolean countdownFinish = false;
protected boolean runRace = true;
private int lastFPS = 20;
@@ -202,8 +202,6 @@ public class Race implements Runnable {
}
}.start();
}
public void initialiseBoats() {
Leg officialStart = legs.get(0);
String name = officialStart.getName();