diff --git a/src/Acceleration.java b/src/Acceleration.java index e44caaa..37babc8 100644 --- a/src/Acceleration.java +++ b/src/Acceleration.java @@ -1,23 +1,21 @@ -import java.util.*; - public class Acceleration { private double mass; - private Vector2 force; + private Pair force; private Velocity velocity; private Onground onground; - private Vector2 acceleration; + private Pair acceleration; public void updateMass(double mass) { this.mass = mass; - acceleration = (this.onground.getOnground() ? new AbstractMap.SimpleEntry<>((force.getKey() / mass), 0.0) - : new Vector2((force.getX() / mass), (force.getY() / mass))); + acceleration = (this.onground.getOnground() ? new Pair<>((force.getX() / mass), 0.0) + : new Pair<>((force.getX() / mass), (force.getY() / mass))); velocity.updateAcceleration(acceleration); } - public void updateForce(Vector2 force) { + public void updateForce(Pair force) { this.force = force; - acceleration = (this.onground.getOnground() ? new Vector2((force.getX() / mass), 0.0) - : new Vector2((force.getX() / mass), (force.getY() / mass))); + acceleration = (this.onground.getOnground() ? new Pair<>((force.getX() / mass), 0.0) + : new Pair<>((force.getX() / mass), (force.getY() / mass))); velocity.updateAcceleration(acceleration); } @@ -26,7 +24,7 @@ this.onground = onground; } - public Vector2 getAcceleration() { + public Pair getAcceleration() { return acceleration; } } \ No newline at end of file