Files
SENG302/visualiser/src/main/java/seng302/Mock/StreamedBoat.java
T
cbt24 3f42d56502 Merge remote-tracking branch 'remotes/origin/splitIntoTwoModules' into NetworkedVisualiser
# Conflicts:
#	visualiser/src/main/java/seng302/VisualiserInput.java
2017-05-01 16:00:11 +12:00

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;
}
}