62 lines
2.2 KiB
C#
62 lines
2.2 KiB
C#
|
namespace ProjectCruiser;
|
|||
|
/// <summary>
|
|||
|
/// Класс-сущность "крейсер"
|
|||
|
/// </summary>
|
|||
|
public class EntityCruiser
|
|||
|
{
|
|||
|
/// <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 HelicopterArea { get; private set; }
|
|||
|
/// <summary>
|
|||
|
/// Признак (опция) наличие шлюпок
|
|||
|
/// </summary>
|
|||
|
|
|||
|
public bool Boat { get; private set; }
|
|||
|
/// <summary>
|
|||
|
/// Признак (опция) наличие тц
|
|||
|
/// </summary>
|
|||
|
public bool Weapon { 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="helicopterArea">вертолетная площадка</param>
|
|||
|
/// <param name="boat">шлюпки</param>
|
|||
|
/// <param name="wepon">наличие тц</param>
|
|||
|
public void Init(int speed, double weight, Color bodyColor, Color
|
|||
|
additionalColor, bool helicopterArea, bool boat, bool wepon)
|
|||
|
{
|
|||
|
Speed = speed;
|
|||
|
Weight = weight;
|
|||
|
BodyColor = bodyColor;
|
|||
|
AdditionalColor = additionalColor;
|
|||
|
HelicopterArea = helicopterArea;
|
|||
|
Boat = boat;
|
|||
|
Weapon = wepon;
|
|||
|
}
|
|||
|
}
|