ISEbd-12_Sinelnikova_A.V._S.../ProjectCruiser/EntityCruiser.cs
2024-02-21 16:56:08 +04:00

62 lines
2.2 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 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;
}
}