43 lines
1.0 KiB
C#
43 lines
1.0 KiB
C#
|
namespace ProjectBus.Entities;
|
|||
|
|
|||
|
/// <summary>
|
|||
|
/// Класс-сущность "Автобус"
|
|||
|
/// </summary>
|
|||
|
|
|||
|
public class EntitySimpleBus
|
|||
|
{
|
|||
|
/// <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 double Step => Speed * 100 / Weight;
|
|||
|
|
|||
|
/// <summary>
|
|||
|
/// Конструктор сущности
|
|||
|
/// </summary>
|
|||
|
/// <param name="speed">Скорость</param>
|
|||
|
/// <param name="weight">Вес автобуса</param>
|
|||
|
/// <param name="bodyColor">Основной цвет</param>
|
|||
|
public EntitySimpleBus(int speed, double weight, Color bodyColor)
|
|||
|
{
|
|||
|
Speed = speed;
|
|||
|
Weight = weight;
|
|||
|
BodyColor = bodyColor;
|
|||
|
}
|
|||
|
}
|