53 lines
1.2 KiB
Java
53 lines
1.2 KiB
Java
package seng302.Mock;
|
|
|
|
import javafx.scene.paint.Color;
|
|
import org.geotools.referencing.GeodeticCalculator;
|
|
import seng302.GPSCoordinate;
|
|
import seng302.Model.Boat;
|
|
import seng302.Model.BoatInRace;
|
|
import seng302.Model.Leg;
|
|
import seng302.Model.Marker;
|
|
|
|
/**
|
|
* Created by Joseph on 24/04/2017.
|
|
*/
|
|
public class StreamedBoat extends Boat {
|
|
private int sourceID;
|
|
private boolean dnf = false;
|
|
|
|
private void init() {
|
|
this.velocity = 0;
|
|
}
|
|
|
|
public StreamedBoat(int sourceID, String name, String abbrev) {
|
|
super(name, abbrev);
|
|
this.sourceID = sourceID;
|
|
this.init();
|
|
}
|
|
|
|
public StreamedBoat(int sourceID) {
|
|
super("None", "None");
|
|
this.sourceID = sourceID;
|
|
this.init();
|
|
}
|
|
|
|
public int getSourceID() {
|
|
return sourceID;
|
|
}
|
|
|
|
/**
|
|
* Calculates the azimuth of the travel via heading of the boat
|
|
*
|
|
* @return the direction that the boat is heading towards in degrees (-180 to 180).
|
|
*/
|
|
public double calculateAzimuth() {
|
|
double azimuth;
|
|
if (heading <= 180) {
|
|
azimuth = heading;
|
|
} else {
|
|
azimuth = -heading + 180;
|
|
}
|
|
return azimuth;
|
|
}
|
|
}
|