diff --git a/src/EntityWarship.java b/src/EntityWarship.java index bfa12b0..c3fc3c4 100644 --- a/src/EntityWarship.java +++ b/src/EntityWarship.java @@ -1,5 +1,29 @@ package src; +import java.awt.*; +import java.util.Random; + public class EntityWarship { + private int Speed; + private void setSpeed(int speed){this.Speed = speed;} + public int getSpeed(){return Speed;} + + private float Weight; + private void setWeight(float weight){this.Weight = weight;} + public float getWeight(){return Weight;} + + private Color BodyColor ; + private void setBodyColor (Color bodyColor){this.BodyColor = 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 * 100 / Weight; + } }