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

30 lines
682 B
Java

import java.awt.*;
import java.util.*;
public class EntityAirBomber
{
private int Speed;
private float Weight;
private Color BodyColor;
private float Step;
public EntityAirBomber(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; }
}