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

30 lines
682 B
Java
Raw Permalink 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;
2022-12-13 20:24:12 +04:00
public EntityAirBomber(int speed, float weight, Color bodyColor)
2022-11-28 00:15:39 +04:00
{
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; }
}