Food class

This commit is contained in:
Leen Dereu
2018-04-03 12:48:49 +02:00
parent 6cd76282c0
commit 8166920c94

View File

@@ -1,5 +1,39 @@
package worms.model; package worms.model;
public class Food { import static java.lang.Math.*;
public class Food {
// region location
//===================================================================================
//===================================================================================
// endregion
// region shape
//===================================================================================
final double radius = 0.20;
public double getMass() {
return this.mass;
}
public void setMass() {
final double rho = 150;
double m = rho * (4/3 * PI * pow(radius, 3));
this.mass = m;
}
public double mass;
//===================================================================================
// endregion
// region eat
//===================================================================================
//===================================================================================
// endregion
} }