diff --git a/src/Acceleration.java b/src/Acceleration.java index c60c686..aa03887 100644 --- a/src/Acceleration.java +++ b/src/Acceleration.java @@ -2,40 +2,41 @@ public class Acceleration { private double massValue; - private Map.Entry forceValue; + private Vector2 forceValue; private Velocity velocity; private Onground onground; - private Map.Entry value; + private Vector2 value; public void updateByMass(double mass) { this.massValue = mass; - Map.Entry temp_l0; + Vector2 temp_l0; if (this.onground.getOnground()) { - temp_l0 = new AbstractMap.SimpleEntry<>((forceValue.getKey() / mass), 0.0); + temp_l0 = new Vector2((forceValue.getX() / mass), 0.0); } else { - temp_l0 = new AbstractMap.SimpleEntry<>((forceValue.getKey() / mass), (forceValue.getValue() / mass)); + temp_l0 = new Vector2((forceValue.getX() / mass), (forceValue.getY() / mass)); } value = temp_l0; velocity.updateByAcceleration(value); } - public void updateByForce(Map.Entry force) { + public void updateByForce(Vector2 force) { this.forceValue = force; - Map.Entry temp_l1; + Vector2 temp_l1; if (this.onground.getOnground()) { - temp_l1 = new AbstractMap.SimpleEntry<>((force.getKey() / massValue), 0.0); + temp_l1 = new Vector2((force.getX() / massValue), 0.0); } else { - temp_l1 = new AbstractMap.SimpleEntry<>((force.getKey() / massValue), (force.getValue() / massValue)); + temp_l1 = new Vector2((force.getX() / massValue), (force.getY() / massValue)); } value = temp_l1; velocity.updateByAcceleration(value); } public Acceleration(Velocity velocity, Onground onground) { + this.velocity = velocity; this.onground = onground; } - public Map.Entry getValue() { + public Vector2 getValue() { return value; } } \ No newline at end of file