package entities; public class Acceleration { private Pair<Double> force = new Pair<>(0.0,0.0); private double mass = 1.0; private Velocity velocity; private Onground onground; private Pair<Double> value = new Pair<>(0.0,0.0); public void updateForce(Pair<Double> force) { this.force = force; Pair<Double> temp_if10; if (this.onground.getValue()) { temp_if10 = new Pair<>((force.getLeft()/mass),0.0); } else { temp_if10 = new Pair<>((force.getLeft()/mass),(force.getRight()/mass)); } value = temp_if10; velocity.updateAcceleration(value); } public void updateMass(double mass) { this.mass = mass; Pair<Double> temp_if13; if (this.onground.getValue()) { temp_if13 = new Pair<>((force.getLeft()/mass),0.0); } else { temp_if13 = new Pair<>((force.getLeft()/mass),(force.getRight()/mass)); } value = temp_if13; velocity.updateAcceleration(value); } public Acceleration(Velocity velocity, Onground onground) { this.velocity = velocity; this.onground = onground; } public Pair<Double> getValue() { return value; } }