From cf138734b770d3dcadfa8000e91c2925921fe086 Mon Sep 17 00:00:00 2001 From: F1rsTTeaM Date: Sat, 23 Mar 2024 15:18:01 +0400 Subject: [PATCH] =?UTF-8?q?=D0=A0=D0=B5=D1=88=D0=B5=D0=BD=D0=B8=D0=B5=20?= =?UTF-8?q?=D0=BA=D0=BE=D0=BD=D1=84=D0=BB=D0=B8=D0=BA=D1=82=D0=B0=205?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../EntityAirplane.cs | 41 +++++++++++++++++++ .../EntityAirplaneWithRadar.cs | 39 ++++++++++++++++++ 2 files changed, 80 insertions(+) create mode 100644 AirplaneWithRadar/ProjectAirplaneWithRadar/EntityAirplane.cs create mode 100644 AirplaneWithRadar/ProjectAirplaneWithRadar/EntityAirplaneWithRadar.cs diff --git a/AirplaneWithRadar/ProjectAirplaneWithRadar/EntityAirplane.cs b/AirplaneWithRadar/ProjectAirplaneWithRadar/EntityAirplane.cs new file mode 100644 index 0000000..0548e44 --- /dev/null +++ b/AirplaneWithRadar/ProjectAirplaneWithRadar/EntityAirplane.cs @@ -0,0 +1,41 @@ +namespace ProjectAirplaneWithRadar +{ + /// + /// Класс-сущность "Самолет" + /// + public class EntityAirplane + { + /// + /// Скорость + /// + public int Speed { get; private set; } + + /// + /// Вес + /// + public double Weight { get; private set; } + + /// + /// Основной цвет + /// + public Color BodyColor { get; private set; } + + /// + /// Шаг перемещения автомобиля + /// + public double Step => Speed * 100 / Weight; + + /// + /// Конструктор сущности + /// + /// Скорость + /// Вес + /// Основной цвет + public EntityAirplane(int speed, double weight, Color bodyColor) + { + Speed = speed; + Weight = weight; + BodyColor = bodyColor; + } + } +} diff --git a/AirplaneWithRadar/ProjectAirplaneWithRadar/EntityAirplaneWithRadar.cs b/AirplaneWithRadar/ProjectAirplaneWithRadar/EntityAirplaneWithRadar.cs new file mode 100644 index 0000000..e4c884e --- /dev/null +++ b/AirplaneWithRadar/ProjectAirplaneWithRadar/EntityAirplaneWithRadar.cs @@ -0,0 +1,39 @@ +namespace ProjectAirplaneWithRadar +{ + /// + /// Класс-сущность "Самолет с радаром" + /// + public class EntityAirplaneWithRadar : EntityAirplane + { + /// + /// Дополнительный цвет (для опциональных элементов) + /// + public Color AdditionalColor { get; private set; } + + /// + /// Признак (опция) наличия шасси + /// + public bool Wheels { get; private set; } + + /// + /// Признак (опция) наличия радар + /// + public bool Radar { get; private set; } + + /// + /// Инициализация полей объекта-класса самолета с радаром + /// + /// Скорость + /// Вес + /// Основной цвет + /// Дополнительный цвет + /// Шасси + /// Радар + public EntityAirplaneWithRadar(int speed, double weight, Color bodyColor, Color additionalColor, bool wheels, bool radar) : base(speed, weight, bodyColor) + { + AdditionalColor = additionalColor; + Wheels = wheels; + Radar = radar; + } + } +}