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; + } + } +}