import java.util.*; public class Position { private Ground ground; private Pair<Double> value; public void updateVelocity(Pair<Double> velocity) { Pair<Double> temp_l4; if(((this.ground.getGround()==true)&&((this.value.getSecond()+(0.01*velocity.getSecond()))<0.0))) { temp_l4 = new Pair<>((this.value.getFirst()+(0.01*velocity.getFirst())), 0.0); } else { temp_l4 = new Pair<>((this.value.getFirst()+(0.01*velocity.getFirst())), (this.value.getSecond()+(0.01*velocity.getSecond()))); } value = temp_l4; } public Position(Ground ground) { this.ground = ground; } public Pair<Double> getValue() { return value; } }