Food class
This commit is contained in:
@@ -1,5 +1,39 @@
|
||||
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
|
||||
}
|
||||
|
Reference in New Issue
Block a user