import java.util.*; public class Move { private Velocity velocity; private Pair<Double> move; public Move(Velocity velocity) { this.velocity = velocity; } public void moveX(double x) { this.move = new Pair<>(x, this.move.getSecond()); velocity.updateMove(move); } public void moveY(double y) { this.move = new Pair<>(this.move.getFirst(), y); } public Pair<Double> getMove() { return move; } }