PIbd-22_Bondarenko_M.S._War.../EntityWarmlyShip.java
Макс Бондаренко c36ffe6688 Suck_Pop
2022-11-16 18:24:14 +04:00

36 lines
834 B
Java
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

import java.awt.*;
import java.util.*;
public class EntityWarmlyShip {
private int Speed; //Скорость
private float Weight; //Вес
private Color BodyColor; //Цвет
private float Step; //Шаг при перемещении
//Инициализация
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;
Step = Speed * 100 / Weight;
}
public int GetSpeed(){
return Speed;
}
public float GetWeight(){
return Weight;
}
public Color GetBodyColor(){
return BodyColor;
}
public float GetStep(){
return Step;
}
}