2024-03-05 09:00:55 +04:00
|
|
|
|
namespace ProjectStormtrooper.Entities;
|
2024-02-18 18:45:41 +04:00
|
|
|
|
/// <summary>
|
|
|
|
|
/// Класс-сущность "Штурмовик"
|
|
|
|
|
/// </summary>
|
2024-03-05 09:00:55 +04:00
|
|
|
|
|
|
|
|
|
public class EntityStormtrooperBase
|
2024-02-18 18:45:41 +04:00
|
|
|
|
{
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Скорость
|
|
|
|
|
/// </summary>
|
|
|
|
|
public int Speed { get; private set; }
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Вес
|
|
|
|
|
/// </summary>
|
|
|
|
|
public double Weight { get; private set; }
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Основной цвет
|
|
|
|
|
/// </summary>
|
|
|
|
|
///
|
|
|
|
|
public Color BodyColor { get; private set; }
|
2024-04-26 15:53:05 +04:00
|
|
|
|
public void SetBodyColor(Color bodyColor)
|
|
|
|
|
{
|
|
|
|
|
BodyColor = bodyColor;
|
|
|
|
|
}
|
2024-03-05 09:00:55 +04:00
|
|
|
|
// <summary>
|
2024-02-18 18:45:41 +04:00
|
|
|
|
/// Шаг перемещения штурмовика
|
|
|
|
|
/// </summary>
|
|
|
|
|
public double Step => Speed * 100 / Weight;
|
|
|
|
|
/// <summary>
|
2024-03-05 09:00:55 +04:00
|
|
|
|
/// Конструктор сущности
|
2024-02-18 18:45:41 +04:00
|
|
|
|
/// </summary>
|
|
|
|
|
/// <param name="speed">Скорость</param>
|
|
|
|
|
/// <param name="weight">Вес </param>
|
|
|
|
|
/// <param name="bodyColor">Основной цвет</param>
|
|
|
|
|
/// <param name="additionalColor">Дополнительный цвет</param>
|
|
|
|
|
/// <param name="rockets">Признак наличия ракет</param>
|
|
|
|
|
/// <param name="bombs">Признак наличия бомб</param>
|
|
|
|
|
|
2024-03-05 09:00:55 +04:00
|
|
|
|
public EntityStormtrooperBase(int speed, double weight, Color bodyColor)
|
2024-02-18 18:45:41 +04:00
|
|
|
|
{
|
|
|
|
|
Speed = speed;
|
|
|
|
|
Weight = weight;
|
|
|
|
|
BodyColor = bodyColor;
|
|
|
|
|
|
2024-03-05 09:00:55 +04:00
|
|
|
|
|
2024-02-18 18:45:41 +04:00
|
|
|
|
}
|
|
|
|
|
}
|