From 1a575280498a2f00f3527489704fc23452885ff2 Mon Sep 17 00:00:00 2001 From: tellsense Date: Sun, 17 Sep 2023 13:26:19 +0400 Subject: [PATCH] =?UTF-8?q?=D0=A1=D0=BE=D0=B7=D0=B4=D0=B0=D0=BD=D0=B8?= =?UTF-8?q?=D0=B5=20=D0=BA=D0=BB=D0=B0=D1=81=D1=81=D0=B0-=D1=81=D1=83?= =?UTF-8?q?=D1=89=D0=BD=D0=BE=D1=81=D1=82=D0=B8=20=D0=BE=D0=B1=D1=8A=D0=B5?= =?UTF-8?q?=D0=BA=D1=82=D0=B0=20=C2=AB=D0=AD=D0=BB=D0=B5=D0=BA=D1=82=D1=80?= =?UTF-8?q?=D0=BE=D0=BB=D0=BE=D0=BA=D0=BE=D0=BC=D0=BE=D1=82=D0=B8=D0=B2?= =?UTF-8?q?=C2=BB?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../EntityElectricLocomotive.cs | 41 +++++++++++++++++++ 1 file changed, 41 insertions(+) create mode 100644 ElectricLocomotive/ElectricLocomotive/EntityElectricLocomotive.cs diff --git a/ElectricLocomotive/ElectricLocomotive/EntityElectricLocomotive.cs b/ElectricLocomotive/ElectricLocomotive/EntityElectricLocomotive.cs new file mode 100644 index 0000000..2382219 --- /dev/null +++ b/ElectricLocomotive/ElectricLocomotive/EntityElectricLocomotive.cs @@ -0,0 +1,41 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace ElectricLocomotive +{ + public class EntityElectricLocomotive + { + public int Speed { get; private set; } + public double Weight { get; private set; } + public Color BodyColor { get; private set; } + public Color AdditionalColor { get; private set; } + public bool Pantograph { get; private set; } + public bool RailWay { get; private set; } + public bool Compartment { get; private set; } + public double Step => (double)Speed * 100 / Weight; + /// + /// Инициализация полей объекта-класса локомотива + /// + /// Скорость + /// Вес локомотива + /// Основной цвет + /// Дополнительный цвет + /// Признак наличия токоприемника + /// Признак наличия железной дороги + /// Признак наличия отсеков под электрические батареи + public void Init(int speed, double weight, Color bodyColor, Color + additionalColor, bool pantograph, bool railway, bool compartment) + { + Speed = speed; + Weight = weight; + BodyColor = bodyColor; + AdditionalColor = additionalColor; + Pantograph = pantograph; + RailWay = railway; + Compartment = compartment; + } + } +}