Mark drawing moved to MarkGroup class. RaceObject and it's sub classes now describe

all functionality required for a on screen object. Improved wakes. Branch currently
untested.

#story[812, 820] #refactor #implement.
This commit is contained in:
cir27
2017-04-27 02:44:25 +12:00
parent eaff4c5aac
commit 245bd184b4
7 changed files with 392 additions and 259 deletions
+31 -7
View File
@@ -8,11 +8,14 @@ import javafx.scene.Group;
*/
public abstract class RaceObject extends Group {
double rotationalGoal;
double currentRotation;
double rotationalVelocity;
double pixelVelocityX;
double pixelVelocityY;
//Time between sections of race - Should be changed to 200 for actual program.
protected static double expectedUpdateInterval = 2000;
protected double rotationalGoal;
protected double currentRotation;
protected double rotationalVelocity;
protected double pixelVelocityX;
protected double pixelVelocityY;
public boolean isSamePos (Point2D point) {
return point.getX() == super.getLayoutX() && point.getY() == super.getLayoutY();
@@ -21,12 +24,33 @@ public abstract class RaceObject extends Group {
public Point2D getPosition () {
return new Point2D(super.getLayoutX(), getLayoutY());
}
public abstract void setDestination (double x, double y, double rotation);
public abstract void setDestination (double x, double y);
public static double getExpectedUpdateInterval() {
return expectedUpdateInterval;
}
public static void setExpectedUpdateInterval(double expectedUpdateInterval) {
RaceObject.expectedUpdateInterval = expectedUpdateInterval;
}
public abstract void setDestination (double x, double y, double rotation, int... raceIds);
public abstract void setDestination (double x, double y, int... raceIds);
public abstract void updatePosition (double timeInterval);
public abstract void moveTo (double x, double y, double rotation);
public abstract void moveTo (double x, double y);
public abstract void moveGroupBy(double x, double y, double rotation);
public abstract void rotateTo (double rotation);
public abstract boolean hasRaceId (int... raceIds);
public abstract int[] getRaceIds ();
public abstract void toggleAnnotations ();
}