mirror of
https://github.com/michaelrausch/Party-Parrots-At-Sea.git
synced 2026-05-09 06:18:44 +00:00
Merge branch '1273_Changing_Cameras' into 1273_Skybox
This commit is contained in:
@@ -6,6 +6,7 @@ import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Observable;
|
||||
import java.util.Observer;
|
||||
import java.util.Timer;
|
||||
import javafx.beans.property.ReadOnlyDoubleProperty;
|
||||
import javafx.beans.property.ReadOnlyDoubleWrapper;
|
||||
import javafx.beans.property.ReadOnlyIntegerProperty;
|
||||
@@ -18,6 +19,7 @@ import javafx.scene.paint.Color;
|
||||
import jdk.nashorn.internal.objects.annotations.Function;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import seng302.visualiser.fxObjects.assets_3D.BoatMeshType;
|
||||
import seng302.model.token.TokenType;
|
||||
import seng302.visualiser.fxObjects.assets_3D.BoatObject;
|
||||
|
||||
@@ -47,7 +49,7 @@ public class ClientYacht extends Observable {
|
||||
private Logger logger = LoggerFactory.getLogger(ClientYacht.class);
|
||||
|
||||
|
||||
private String boatType;
|
||||
private BoatMeshType boatType;
|
||||
private Integer sourceId;
|
||||
private String hullID; //matches HullNum in the XML spec.
|
||||
private String shortName;
|
||||
@@ -57,7 +59,7 @@ public class ClientYacht extends Observable {
|
||||
private TokenType powerUp;
|
||||
|
||||
private Long estimateTimeAtFinish;
|
||||
private Boolean sailIn = false;
|
||||
private Boolean sailIn = true;
|
||||
private Integer currentMarkSeqID = 0;
|
||||
private Long markRoundTime;
|
||||
private Long timeTillNext;
|
||||
@@ -67,6 +69,8 @@ public class ClientYacht extends Observable {
|
||||
private Integer boatStatus;
|
||||
private Double currentVelocity;
|
||||
|
||||
Timer t;
|
||||
|
||||
private BoatObject boatObject;
|
||||
|
||||
private List<YachtLocationListener> locationListeners = new ArrayList<>();
|
||||
@@ -76,9 +80,10 @@ public class ClientYacht extends Observable {
|
||||
private ReadOnlyLongWrapper timeTillNextProperty = new ReadOnlyLongWrapper();
|
||||
private ReadOnlyLongWrapper timeSinceLastMarkProperty = new ReadOnlyLongWrapper();
|
||||
private ReadOnlyIntegerWrapper placingProperty = new ReadOnlyIntegerWrapper();
|
||||
private ReadOnlyDoubleWrapper headingProperty = new ReadOnlyDoubleWrapper();
|
||||
private Color colour;
|
||||
|
||||
public ClientYacht(String boatType, Integer sourceId, String hullID, String shortName,
|
||||
public ClientYacht(BoatMeshType boatType, Integer sourceId, String hullID, String shortName,
|
||||
String boatName, String country) {
|
||||
this.boatType = boatType;
|
||||
this.sourceId = sourceId;
|
||||
@@ -88,6 +93,7 @@ public class ClientYacht extends Observable {
|
||||
this.country = country;
|
||||
this.location = new GeoPoint(57.670341, 11.826856);
|
||||
this.heading = 120.0; //In degrees
|
||||
this.headingProperty.set(this.heading);
|
||||
this.currentVelocity = 0d;
|
||||
this.boatStatus = 1;
|
||||
this.colour = Color.rgb(0, 0, 0, 1.0);
|
||||
@@ -102,7 +108,7 @@ public class ClientYacht extends Observable {
|
||||
super.addObserver(o);
|
||||
}
|
||||
|
||||
public String getBoatType() {
|
||||
public BoatMeshType getBoatType() {
|
||||
return boatType;
|
||||
}
|
||||
|
||||
@@ -246,6 +252,7 @@ public class ClientYacht extends Observable {
|
||||
|
||||
public void setHeading(Double heading) {
|
||||
this.heading = heading;
|
||||
setHeadingProperty();
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -274,10 +281,10 @@ public class ClientYacht extends Observable {
|
||||
this.colour = colour;
|
||||
}
|
||||
|
||||
|
||||
public void updateLocation(double lat, double lng, double heading, double velocity) {
|
||||
setLocation(lat, lng);
|
||||
this.heading = heading;
|
||||
setHeadingProperty();
|
||||
this.currentVelocity = velocity;
|
||||
updateVelocityProperty(velocity);
|
||||
for (YachtLocationListener yll : locationListeners) {
|
||||
@@ -285,6 +292,10 @@ public class ClientYacht extends Observable {
|
||||
}
|
||||
}
|
||||
|
||||
private void setHeadingProperty() {
|
||||
headingProperty.set(heading);
|
||||
}
|
||||
|
||||
public void addLocationListener(YachtLocationListener listener) {
|
||||
locationListeners.add(listener);
|
||||
}
|
||||
@@ -325,4 +336,9 @@ public class ClientYacht extends Observable {
|
||||
public BoatObject getBoatObject() {
|
||||
return this.boatObject;
|
||||
}
|
||||
|
||||
public ReadOnlyDoubleWrapper getHeadingProperty() {
|
||||
return headingProperty;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user