Решение конфликта 5
This commit is contained in:
parent
dae9548900
commit
cf138734b7
41
AirplaneWithRadar/ProjectAirplaneWithRadar/EntityAirplane.cs
Normal file
41
AirplaneWithRadar/ProjectAirplaneWithRadar/EntityAirplane.cs
Normal file
@ -0,0 +1,41 @@
|
|||||||
|
namespace ProjectAirplaneWithRadar
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// Класс-сущность "Самолет"
|
||||||
|
/// </summary>
|
||||||
|
public class EntityAirplane
|
||||||
|
{
|
||||||
|
/// <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 double Step => Speed * 100 / Weight;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Конструктор сущности
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="speed">Скорость</param>
|
||||||
|
/// <param name="weight">Вес</param>
|
||||||
|
/// <param name="bodyColor">Основной цвет</param>
|
||||||
|
public EntityAirplane(int speed, double weight, Color bodyColor)
|
||||||
|
{
|
||||||
|
Speed = speed;
|
||||||
|
Weight = weight;
|
||||||
|
BodyColor = bodyColor;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,39 @@
|
|||||||
|
namespace ProjectAirplaneWithRadar
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// Класс-сущность "Самолет с радаром"
|
||||||
|
/// </summary>
|
||||||
|
public class EntityAirplaneWithRadar : EntityAirplane
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// Дополнительный цвет (для опциональных элементов)
|
||||||
|
/// </summary>
|
||||||
|
public Color AdditionalColor { get; private set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Признак (опция) наличия шасси
|
||||||
|
/// </summary>
|
||||||
|
public bool Wheels { get; private set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Признак (опция) наличия радар
|
||||||
|
/// </summary>
|
||||||
|
public bool Radar { get; private set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Инициализация полей объекта-класса самолета с радаром
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="speed">Скорость</param>
|
||||||
|
/// <param name="weight">Вес</param>
|
||||||
|
/// <param name="bodyColor">Основной цвет</param>
|
||||||
|
/// <param name="additionalColor">Дополнительный цвет</param>
|
||||||
|
/// <param name="wheels">Шасси</param>
|
||||||
|
/// <param name="radar">Радар</param>
|
||||||
|
public EntityAirplaneWithRadar(int speed, double weight, Color bodyColor, Color additionalColor, bool wheels, bool radar) : base(speed, weight, bodyColor)
|
||||||
|
{
|
||||||
|
AdditionalColor = additionalColor;
|
||||||
|
Wheels = wheels;
|
||||||
|
Radar = radar;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
Loading…
Reference in New Issue
Block a user