Pibd-22_Emelyanov_A.S._Airb.../EntityPlane.java
2022-11-29 20:49:03 +04:00

32 lines
705 B
Java

import java.awt.*;
import java.util.Random;
public class EntityPlane {
private int Speed;
public int GetSpeed() {
return Speed;
}
private float Weight;
public float GetWeight() {
return Weight;
}
private Color BodyColor;
public Color GetBodyColor() {
return BodyColor;
}
public float Step;
public float GetStep(){return Step;}
public EntityPlane(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 / (int)Weight;
}
}