| | import java.util.*; |
---|
| | |
---|
| | public class JumpGame { |
---|
| | private Time time = new Time(); |
---|
| | private Position position = new Position(); |
---|
| | private Gameover gameover = new Gameover(position); |
---|
| | private Ground ground = new Ground(position); |
---|
| | private Onground onground = new Onground(ground,position); |
---|
| | private Velocity velocity = new Velocity(position,onground); |
---|
| | private Clear clear = new Clear(position); |
---|
| | private Move move = new Move(velocity); |
---|
| | private Acceleration acceleration = new Acceleration(velocity,onground); |
---|
| | private Force force = new Force(acceleration); |
---|
| | private Mass mass = new Mass(acceleration); |
---|
| | public void gravity(double y) { |
---|
| | this.force.gravity(y); |
---|
| | this.time.gravity(y); |
---|
| | } |
---|
| | public void moveY(double y) { |
---|
| | this.move.moveY(y); |
---|
| | } |
---|
| | public void moveX(double x) { |
---|
| | this.move.moveX(x); |
---|
| | } |
---|
| | public void setMass(double x) { |
---|
| | this.mass.setMass(x); |
---|
| | } |
---|
| | public Map.Entry<Double, Double> getAcceleration() { |
---|
| | return acceleration.getAcceleration(); |
---|
| | } |
---|
| | public Map.Entry<Double, Double> getMove() { |
---|
| | return move.getMove(); |
---|
| | } |
---|
| | public double getMass() { |
---|
| | return mass.getMass(); |
---|
| | } |
---|
| | public boolean getClear() { |
---|
| | return clear.getClear(); |
---|
| | } |
---|
| | public boolean getGround() { |
---|
| | return ground.getGround(); |
---|
| | } |
---|
| | public Map.Entry<Double, Double> getForce() { |
---|
| | return force.getForce(); |
---|
| | } |
---|
| | public Map.Entry<Double, Double> getVelocity() { |
---|
| | return velocity.getVelocity(); |
---|
| | } |
---|
| | public Map.Entry<Double, Double> getPosition() { |
---|
| | return position.getPosition(); |
---|
| | } |
---|
| | public boolean getOnground() { |
---|
| | return onground.getOnground(); |
---|
| | } |
---|
| | public double getTime() { |
---|
| | return time.getTime(); |
---|
| | } |
---|
| | public boolean getGameover() { |
---|
| | return gameover.getGameover(); |
---|
| | } |
---|
| | private Time time = new Time(); |
---|
| | private Ground ground = new Ground(); |
---|
| | private Position position = new Position(ground); |
---|
| | private Gameover gameover = new Gameover(position); |
---|
| | private Onground onground = new Onground(ground, position); |
---|
| | private Velocity velocity = new Velocity(position, onground); |
---|
| | private Clear clear = new Clear(position); |
---|
| | private Move move = new Move(velocity); |
---|
| | private Acceleration acceleration = new Acceleration(velocity, onground); |
---|
| | private Force force = new Force(acceleration); |
---|
| | private Mass mass = new Mass(acceleration); |
---|
| | |
---|
| | public void gravity(double y) { |
---|
| | this.force.gravity(y); |
---|
| | this.time.gravity(y); |
---|
| | } |
---|
| | |
---|
| | public void moveX(double x) { |
---|
| | this.move.moveX(x); |
---|
| | } |
---|
| | |
---|
| | public void moveY(double y) { |
---|
| | this.move.moveY(y); |
---|
| | } |
---|
| | |
---|
| | public void setMass(double x) { |
---|
| | this.mass.setValue(x); |
---|
| | } |
---|
| | |
---|
| | public Map.Entry<Double, Double> getAcceleration() { |
---|
| | return acceleration.getValue(); |
---|
| | } |
---|
| | |
---|
| | public Map.Entry<Double, Double> getMove() { |
---|
| | return move.getValue(); |
---|
| | } |
---|
| | |
---|
| | public double getMass() { |
---|
| | return mass.getValue(); |
---|
| | } |
---|
| | |
---|
| | public boolean getClear() { |
---|
| | return clear.getClear(); |
---|
| | } |
---|
| | |
---|
| | public boolean getGround() { |
---|
| | return ground.getValue(); |
---|
| | } |
---|
| | |
---|
| | public Map.Entry<Double, Double> getForce() { |
---|
| | return force.getValue(); |
---|
| | } |
---|
| | |
---|
| | public Map.Entry<Double, Double> getVelocity() { |
---|
| | return velocity.getValue(); |
---|
| | } |
---|
| | |
---|
| | public Map.Entry<Double, Double> getPosition() { |
---|
| | return position.getValue(); |
---|
| | } |
---|
| | |
---|
| | public boolean getOnground() { |
---|
| | return onground.getOnground(); |
---|
| | } |
---|
| | |
---|
| | public double getTime() { |
---|
| | return time.getValue(); |
---|
| | } |
---|
| | |
---|
| | public boolean getGameover() { |
---|
| | return gameover.getGameover(); |
---|
| | } |
---|
| | } |
---|
| | |