PIbd-22_Aleikin_A.M._AirBom.../EntityAirBomber.java

30 lines
676 B
Java
Raw Normal View History

2022-11-28 00:15:39 +04:00
import java.awt.*;
import java.util.*;
public class EntityAirBomber
{
private int Speed;
private float Weight;
private Color BodyColor;
private float Step;
public void Init(int speed, float weight, Color bodyColor)
{
Random rnd = new Random();
Speed = speed <= 0 ? rnd.nextInt(50, 150) : speed;
Weight = weight <= 0 ? rnd.nextInt(40, 70) : weight;
BodyColor = bodyColor;
Step = Speed * 100 / Weight;
}
public int GetSpeed() { return Speed; }
public float GetWeight() {
return Weight;
}
public Color GetColor() { return BodyColor; }
public float GetStep() { return Step; }
}