PIbd-12_Karamushko_M.K._Air.../EntityAircraft.java

22 lines
474 B
Java
Raw Permalink Normal View History

2022-10-28 15:45:35 +04:00
import java.awt.*;
import java.util.Random;
class EntityAircraft
{
public int Speed;
public float Weight;
public Color BodyColor;
public float Step;
2022-11-10 16:44:45 +04:00
public EntityAircraft(int speed, float weight, Color bodyColor)
2022-10-28 15:45:35 +04:00
{
Random rnd = new Random();
Speed = speed <= 0 ? rnd.nextInt(50, 150) : speed;
Weight = weight <= 0 ? rnd.nextInt(50, 70) : weight;
BodyColor = bodyColor;
Step = Speed * 100 / Weight;
}
}