PIbd-21_MalafeevL.S._Cruise.../Cruiser/Entities/EntityCruiser.cs

47 lines
1.4 KiB
C#
Raw Normal View History

2023-09-25 11:15:05 +04:00
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
2023-09-25 14:09:42 +04:00
namespace Cruiser.Entities
2023-09-25 11:15:05 +04:00
{
2023-09-25 14:09:42 +04:00
/// <summary>
/// Класс-сущность "Крейсер"
/// </summary>
2023-09-25 11:15:05 +04:00
public class EntityCruiser
{
/// <summary>
/// Скорость
/// </summary>
public int Speed { get; private set; }
/// <summary>
/// Вес
/// </summary>
public double Weight { get; private set; }
/// <summary>
/// Основной цвет
/// </summary>
2023-11-24 12:12:46 +04:00
public Color BodyColor { get; set; }
2023-09-25 11:15:05 +04:00
/// <summary>
/// Второстепенный цвет
/// </summary>
2023-11-24 12:12:46 +04:00
public Color SecondColor { get; set; }
2023-09-25 11:15:05 +04:00
/// <summary>
/// Шаг перемещения Крейсера
/// </summary>
public double Step => (double)Speed * 100 / Weight;
/// <param name="speed">Скорость</param>
/// <param name="weight">Вес Крейсера</param>
/// <param name="bodyColor">Основной цвет</param>
/// <param name="secColor">Второстепенный цвет</param>
2023-09-25 14:09:42 +04:00
public EntityCruiser(int speed, double weight, Color bodyColor, Color secColor)
2023-09-25 11:15:05 +04:00
{
Speed = speed;
Weight = weight;
BodyColor = bodyColor;
SecondColor = secColor;
}
}
}