Enabled boat path for only the player.

#story[987]
This commit is contained in:
Calum
2017-07-26 16:01:01 +12:00
parent 4e5b67abfa
commit 8fc00fd750
2 changed files with 24 additions and 23 deletions
@@ -111,7 +111,7 @@ public class BoatAnnotations extends Group{
} }
} }
private void setVisible(boolean nameVisibility, boolean speedVisibility, void setVisible(boolean nameVisibility, boolean speedVisibility,
boolean estTimeVisibility, boolean lastMarkVisibility) { boolean estTimeVisibility, boolean lastMarkVisibility) {
int totalVisible = 0; int totalVisible = 0;
+23 -22
View File
@@ -51,6 +51,7 @@ public class BoatGroup extends Group {
private BoatAnnotations boatAnnotations; private BoatAnnotations boatAnnotations;
private Color color; private Color color;
private Boolean isSelected = true; //All boats are initialised as selected\ private Boolean isSelected = true; //All boats are initialised as selected\
private boolean isPlayer = false;
/** /**
* Creates a BoatGroup with the default triangular boat polygon. * Creates a BoatGroup with the default triangular boat polygon.
@@ -173,28 +174,27 @@ public class BoatGroup extends Group {
if (framesToMove <= 0) { if (framesToMove <= 0) {
isStopped = true; isStopped = true;
} }
if (distanceTravelled > 70 && isPlayer) {
distanceTravelled = 0d;
// if (distanceTravelled > 70) { if (lastPoint != null) {
// distanceTravelled = 0d; Line l = new Line(
// lastPoint.getX(),
// if (lastPoint != null) { lastPoint.getY(),
// Line l = new Line( boatPoly.getLayoutX(),
// lastPoint.getX(), boatPoly.getLayoutY()
// lastPoint.getY(), );
// boatPoly.getLayoutX(), l.getStrokeDashArray().setAll(3d, 7d);
// boatPoly.getLayoutY() l.setStroke(boat.getColour());
// ); l.setCache(true);
// l.getStrokeDashArray().setAll(3d, 7d); l.setCacheHint(CacheHint.SPEED);
// l.setStroke(boat.getColour()); lineGroup.getChildren().add(l);
// l.setCache(true); }
// l.setCacheHint(CacheHint.SPEED);
// lineGroup.getChildren().add(l); if (destinationSet) {
// } lastPoint = new Point2D(boatPoly.getLayoutX(), boatPoly.getLayoutY());
// }
// if (destinationSet) { }
// lastPoint = new Point2D(boatPoly.getLayoutX(), boatPoly.getLayoutY());
// }
// }
// wake.updatePosition(); // wake.updatePosition();
} }
@@ -279,7 +279,7 @@ public class BoatGroup extends Group {
} }
public void setVisibility (boolean teamName, boolean velocity, boolean estTime, boolean legTime, boolean trail, boolean wake) { public void setVisibility (boolean teamName, boolean velocity, boolean estTime, boolean legTime, boolean trail, boolean wake) {
boatAnnotations.setVisibile(teamName, velocity, estTime, legTime); boatAnnotations.setVisible(teamName, velocity, estTime, legTime);
this.wake.setVisible(wake); this.wake.setVisible(wake);
this.lineGroup.setVisible(trail); this.lineGroup.setVisible(trail);
} }
@@ -361,5 +361,6 @@ public class BoatGroup extends Group {
boatPoly.setStroke(Color.BLACK); boatPoly.setStroke(Color.BLACK);
boatPoly.setStrokeWidth(3); boatPoly.setStrokeWidth(3);
boatAnnotations.setAsPlayer(); boatAnnotations.setAsPlayer();
isPlayer = true;
} }
} }