From f26f78c652560cd9da238c18e2818278c33a8b48 Mon Sep 17 00:00:00 2001 From: tellsense Date: Mon, 25 Dec 2023 20:00:56 +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=20EntityElectricL?= =?UTF-8?q?ocomotive.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../EntityElectricLocomotive.cs | 34 +++++++++++++++++++ 1 file changed, 34 insertions(+) create mode 100644 ProjectElectricLocomotive/ProjectElectricLocomotive/EntityElectricLocomotive.cs diff --git a/ProjectElectricLocomotive/ProjectElectricLocomotive/EntityElectricLocomotive.cs b/ProjectElectricLocomotive/ProjectElectricLocomotive/EntityElectricLocomotive.cs new file mode 100644 index 0000000..08126ec --- /dev/null +++ b/ProjectElectricLocomotive/ProjectElectricLocomotive/EntityElectricLocomotive.cs @@ -0,0 +1,34 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace ProjectElectricLocomotive +{ + 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 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 compartment) + { + Speed = speed; + Weight = weight; + BodyColor = bodyColor; + AdditionalColor = additionalColor; + Pantograph = pantograph; + Compartment = compartment; + } + } +}