PIbd-21_Markov_D.P._Contain.../EntityShip.java
2022-12-01 23:30:57 +04:00

29 lines
677 B
Java

import java.awt.*;
import java.util.Random;
public class EntityShip {
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 GetStep()
{
return Speed*100/Weight;
}
public void Init(int speed,float weight, Color bodyColor)
{
Random random = new Random();
Speed = speed <= 0 ? random.nextInt(50, 150) : speed;
Weight = weight <= 0 ? random.nextInt(50, 150) : weight;
BodyColor=bodyColor;
}
}