2022-12-17 22:11:24 +04:00
|
|
|
import java.awt.Color;
|
|
|
|
import java.util.Random;
|
|
|
|
|
|
|
|
public class EntityStormtrooper {
|
|
|
|
private int Speed = 0;
|
|
|
|
|
|
|
|
private float Weight = 0;
|
|
|
|
|
|
|
|
private Color BodyColor;
|
|
|
|
|
|
|
|
public float Step;
|
|
|
|
|
|
|
|
public int getSpeed() {
|
|
|
|
return Speed;
|
|
|
|
}
|
|
|
|
|
|
|
|
public float getWeight() {
|
|
|
|
return Weight;
|
|
|
|
}
|
|
|
|
|
|
|
|
public Color getBodyColor() {
|
|
|
|
return BodyColor;
|
|
|
|
}
|
|
|
|
|
2022-12-20 17:17:11 +04:00
|
|
|
public EntityStormtrooper(int speed, float weight, Color bodyColor){
|
2022-12-17 22:11:24 +04:00
|
|
|
Random rnd = new Random();
|
|
|
|
Speed = speed <= 0 ? rnd.nextInt(50 + 1) +50 : speed; //генерация в диапазоне от 50 до 100
|
|
|
|
Weight = weight <= 0 ? rnd.nextInt(50 + 1) +50 : weight;
|
|
|
|
Step = Speed * 100 / Weight;
|
|
|
|
BodyColor = bodyColor;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|