2022-09-25 16:31:57 +04:00
|
|
|
import java.awt.*;
|
|
|
|
import java.util.Random;
|
|
|
|
|
|
|
|
public class EntityArtillery {
|
|
|
|
private int speed;
|
|
|
|
private float weight;
|
|
|
|
private Color bodyColor;
|
|
|
|
|
2022-10-08 14:43:17 +04:00
|
|
|
public EntityArtillery(int speed, float weight, Color bodyColor) {
|
2022-09-25 16:31:57 +04:00
|
|
|
Random rnd = new Random();
|
|
|
|
this.speed = speed <= 0 ? rnd.nextInt(50, 150) : speed;
|
|
|
|
this.weight = weight <= 0 ? rnd.nextInt(40, 70) : weight;
|
|
|
|
this.bodyColor = bodyColor;
|
|
|
|
}
|
|
|
|
|
|
|
|
public int getSpeed() {
|
|
|
|
return speed;
|
|
|
|
}
|
|
|
|
|
|
|
|
public float getWeight() {
|
|
|
|
return weight;
|
|
|
|
}
|
|
|
|
|
|
|
|
public Color getBodyColor() {
|
|
|
|
return bodyColor;
|
|
|
|
}
|
|
|
|
|
|
|
|
public float getStep() {
|
|
|
|
return speed * 100 / weight;
|
|
|
|
}
|
|
|
|
}
|