24 lines
617 B
Java
24 lines
617 B
Java
import java.awt.*;
|
|
import java.util.Random;
|
|
public class EntityWarship {
|
|
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 void Init(int speed, float weight, Color bodyColor)
|
|
{
|
|
Random rnd = new Random();
|
|
Speed = speed <= 0 ? rnd.nextInt(100) + 50 : speed;
|
|
Weight = weight <= 0 ? rnd.nextInt(30)+40 : weight;
|
|
BodyColor= bodyColor;
|
|
Step = Speed * 2000 / Weight;
|
|
}
|
|
|
|
}
|