Tests for calculating leg distance and updating boat positions added
#story[9] #test
This commit is contained in:
@@ -13,6 +13,7 @@ import java.util.ArrayList;
|
||||
* Created by cbt24 on 6/03/17.
|
||||
*/
|
||||
public class ConstantVelocityRace extends Race {
|
||||
|
||||
/**
|
||||
* Initialiser for a Race with constant velocity.
|
||||
* @param startingBoats array of boats
|
||||
|
||||
@@ -55,15 +55,6 @@ public class Leg {
|
||||
return distance;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
*
|
||||
* @return Returns the name of the Leg
|
||||
*/
|
||||
public String toString() {
|
||||
return name;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the coordinates in GPSCoordinate class of the boats starting coordinate.
|
||||
* @return Returns the coordinate of the start of the leg.
|
||||
@@ -101,5 +92,6 @@ public class Leg {
|
||||
calc.setStartingGeographicPoint(startGPSCoordinate.getLongitude(), startGPSCoordinate.getLatitude());
|
||||
calc.setDestinationGeographicPoint(endGPSCoordinate.getLongitude(), endGPSCoordinate.getLatitude());
|
||||
return calc.getOrthodromicDistance() / Constants.NMToMetersConversion;
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
package seng302.Model;
|
||||
|
||||
import com.sun.xml.internal.bind.v2.runtime.reflect.opt.Const;
|
||||
|
||||
import javafx.scene.canvas.Canvas;
|
||||
import javafx.scene.canvas.GraphicsContext;
|
||||
import javafx.scene.paint.Color;
|
||||
@@ -11,9 +11,6 @@ import seng302.GPSCoordinate;
|
||||
import seng302.GraphCoordinate;
|
||||
import seng302.RaceMap;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Random;
|
||||
|
||||
/**
|
||||
* This creates a JavaFX Canvas that is fills it's parent.
|
||||
* Cannot be downsized.
|
||||
|
||||
Reference in New Issue
Block a user