Newer
Older
JumpingGame / src / Mass.java
k-fujii on 10 Sep 2021 346 bytes ・updateメソッドとsetterを分離
import java.util.*;

public class Mass {
	private Acceleration acceleration;
	private double mass;

	public Mass(Acceleration acceleration) {
		this.acceleration = acceleration;
	}

	public void setMass(double x) {
		this.mass = x;
		acceleration.setMass(x);
		acceleration.updateAcceleration();
	}

	public double getMass() {
		return mass;
	}
}