Added abstract class for all javafx object that a displayed during race. Began refactoring of mark implementation to be a subclass of the aforementioned abstract class.

This commit is contained in:
cir27
2017-04-26 21:16:22 +12:00
parent 95bafdc0d1
commit eaff4c5aac
7 changed files with 183 additions and 35 deletions
@@ -0,0 +1,32 @@
package seng302.models;
import javafx.geometry.Point2D;
import javafx.scene.Group;
/**
* Created by CJIRWIN on 26/04/2017.
*/
public abstract class RaceObject extends Group {
double rotationalGoal;
double currentRotation;
double rotationalVelocity;
double pixelVelocityX;
double pixelVelocityY;
public boolean isSamePos (Point2D point) {
return point.getX() == super.getLayoutX() && point.getY() == super.getLayoutY();
}
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 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 boolean hasRaceId (int... raceIds);
public abstract void toggleAnnotations ();
}