|
|
|
|
@ -1,9 +1,6 @@
|
|
|
|
|
package visualiser.model;
|
|
|
|
|
|
|
|
|
|
import javafx.beans.property.BooleanProperty;
|
|
|
|
|
import javafx.beans.property.ObjectProperty;
|
|
|
|
|
import javafx.beans.property.SimpleBooleanProperty;
|
|
|
|
|
import javafx.beans.property.SimpleObjectProperty;
|
|
|
|
|
import javafx.beans.property.*;
|
|
|
|
|
import javafx.scene.paint.Color;
|
|
|
|
|
import network.Messages.Enums.BoatStatusEnum;
|
|
|
|
|
import shared.model.*;
|
|
|
|
|
@ -65,6 +62,7 @@ public class VisualiserBoat extends Boat {
|
|
|
|
|
private ObjectProperty<GPSCoordinate> positionProperty;
|
|
|
|
|
private ObjectProperty<Bearing> bearingProperty;
|
|
|
|
|
private BooleanProperty hasCollided;
|
|
|
|
|
private IntegerProperty healthProperty;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
@ -78,6 +76,7 @@ public class VisualiserBoat extends Boat {
|
|
|
|
|
|
|
|
|
|
this.color = color;
|
|
|
|
|
this.hasCollided = new SimpleBooleanProperty(false);
|
|
|
|
|
this.healthProperty = new SimpleIntegerProperty(100);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@ -281,4 +280,18 @@ public class VisualiserBoat extends Boat {
|
|
|
|
|
public void setHasCollided(boolean hasCollided) {
|
|
|
|
|
this.hasCollided.set(hasCollided);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public IntegerProperty healthProperty() {
|
|
|
|
|
return healthProperty;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
public double getHealth() {
|
|
|
|
|
return healthProperty.get();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
public void setHealth(double healthProperty) {
|
|
|
|
|
this.healthProperty.set((int)healthProperty);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|