mirror of
https://github.com/michaelrausch/Party-Parrots-At-Sea.git
synced 2026-05-09 14:28:43 +00:00
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:
@@ -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 ();
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user