PIbd-14_Rachek_A.S._Base/lab_0/EntityBus.cs
2024-02-29 10:45:00 +04:00

61 lines
2.1 KiB
C#
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.

namespace ProjectBus;
/// <summary>
/// Класс-сущность "Автобус"
/// </summary>
public class EntityBus
{
/// <summary>
/// Скорость
/// </summary>
public int Speed { get; set; }
/// <summary>
/// Вес
/// </summary>
public double Weight { get; set; }
/// <summary>
/// Основной цвет
/// </summary>
public Color BodyColor { get; private set; }
/// <summary>
/// Дополнительный цвет (для опциональных элементов)
/// </summary>
public Color AdditionalColor { get; private set; }
/// <summary>
/// Признак (опция) наличия контейнеров
/// </summary>
public bool AdditionalCompartment { get; private set; }
/// <summary>
/// Признак (опция) наличия крана для разгрузки
/// </summary>
public bool Accordion { get; private set; }
/// <summary>
/// Шаг перемещения автобуса
/// </summary>
public double Step => Speed * 100 / Weight;
/// <summary>
/// Инициализация полей объекта-класса спортивного автомобиля
/// </summary>
/// <param name="speed">Скорость</param>
/// <param name="weight">Вес автобуса</param>
/// <param name="bodyColor">Основной цвет</param>
/// <param name="additionalColor">Дополнительный цвет</param>
/// <param name="additionalCompartment">Признак наличия дополнительного отсека</param>
/// <param name="accordion">Признак наличия гармошки</param>
public void Init(int speed, double weight, Color bodyColor, Color additionalColor, bool additionalCompartment, bool accordion)
{
Speed = speed;
Weight = weight;
BodyColor = bodyColor;
AdditionalColor = additionalColor;
AdditionalCompartment = additionalCompartment;
Accordion = accordion;
}
}