2024-02-18 17:22:50 +04:00
|
|
|
|
namespace ProjectAirplaneWithRadar
|
2024-02-10 18:11:15 +04:00
|
|
|
|
{
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Класс-сущность "Самолет с радаром"
|
|
|
|
|
/// </summary>
|
|
|
|
|
public class EntityAirplaneWithRadar
|
|
|
|
|
{
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Скорость
|
|
|
|
|
/// </summary>
|
|
|
|
|
public int Speed { get; private set; }
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Вес
|
|
|
|
|
/// </summary>
|
|
|
|
|
public double Weight { get; private set; }
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Основной цвет
|
|
|
|
|
/// </summary>
|
|
|
|
|
public Color BodyColor { get; private set; }
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Дополнительный цвет (для опциональных элементов)
|
|
|
|
|
/// </summary>
|
|
|
|
|
public Color AdditionalColor { get; private set; }
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Признак (опция) наличия шасси
|
|
|
|
|
/// </summary>
|
|
|
|
|
public bool Wheels { get; private set; }
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
2024-03-06 15:31:09 +04:00
|
|
|
|
/// Признак (опция) наличия радар
|
2024-02-10 18:11:15 +04:00
|
|
|
|
/// </summary>
|
2024-03-06 15:31:09 +04:00
|
|
|
|
public bool Radar { get; private set; }
|
2024-02-10 18:11:15 +04:00
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Шаг перемещения автомобиля
|
|
|
|
|
/// </summary>
|
|
|
|
|
public double Step => Speed * 100 / Weight;
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
2024-02-18 17:22:50 +04:00
|
|
|
|
/// Инициализация полей объекта-класса самолета с радаром
|
2024-02-10 18:11:15 +04:00
|
|
|
|
/// </summary>
|
|
|
|
|
/// <param name="speed">Скорость</param>
|
2024-02-18 17:22:50 +04:00
|
|
|
|
/// <param name="weight">Вес</param>
|
2024-02-10 18:11:15 +04:00
|
|
|
|
/// <param name="bodyColor">Основной цвет</param>
|
|
|
|
|
/// <param name="additionalColor">Дополнительный цвет</param>
|
2024-02-18 17:22:50 +04:00
|
|
|
|
/// <param name="wheels">Шасси</param>
|
2024-03-06 15:31:09 +04:00
|
|
|
|
/// <param name="radar">Радар</param>
|
|
|
|
|
public void Init(int speed, double weight, Color bodyColor, Color additionalColor, bool wheels, bool radar)
|
2024-02-10 18:11:15 +04:00
|
|
|
|
{
|
|
|
|
|
Speed = speed;
|
|
|
|
|
Weight = weight;
|
|
|
|
|
BodyColor = bodyColor;
|
|
|
|
|
AdditionalColor = additionalColor;
|
|
|
|
|
Wheels = wheels;
|
2024-03-06 15:31:09 +04:00
|
|
|
|
Radar = radar;
|
2024-02-10 18:11:15 +04:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|