From e9c0b5160fce98ef5289660a75d3d82068d5c436 Mon Sep 17 00:00:00 2001 From: AparyanLuiza Date: Thu, 23 Nov 2023 01:10:37 +0400 Subject: [PATCH] =?UTF-8?q?=D0=94=D0=BE=D0=B1=D0=B0=D0=B2=D0=BB=D0=B5?= =?UTF-8?q?=D0=BD=20=D0=BA=D0=BB=D0=B0=D1=81=D1=81=20=D1=81=D1=83=D1=89?= =?UTF-8?q?=D0=BD=D0=BE=D1=81=D1=82=D0=B8=20=D0=B1=D0=B0=D0=B7=D0=BE=D0=B2?= =?UTF-8?q?=D0=BE=D0=B3=D0=BE=20=D0=B8=20=D0=BF=D1=80=D0=BE=D0=B4=D0=B2?= =?UTF-8?q?=D0=B8=D0=BD=D1=83=D1=82=D0=BE=D0=B3=D0=BE=20=D0=BE=D0=B1=D1=8A?= =?UTF-8?q?=D0=B5=D0=BA=D1=82=D0=BE=D0=B2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ProjectBulldozer/DrawningBulldozer.cs | 2 + ProjectBulldozer/Entities/EntityBulldozer.cs | 22 ++++++++++ ProjectBulldozer/Entities/EntityTractor.cs | 22 ++++++++++ ProjectBulldozer/EntityBulldozer.cs | 43 -------------------- 4 files changed, 46 insertions(+), 43 deletions(-) create mode 100644 ProjectBulldozer/Entities/EntityBulldozer.cs create mode 100644 ProjectBulldozer/Entities/EntityTractor.cs delete mode 100644 ProjectBulldozer/EntityBulldozer.cs diff --git a/ProjectBulldozer/DrawningBulldozer.cs b/ProjectBulldozer/DrawningBulldozer.cs index 0bf3ce8..7bb92b0 100644 --- a/ProjectBulldozer/DrawningBulldozer.cs +++ b/ProjectBulldozer/DrawningBulldozer.cs @@ -1,5 +1,7 @@  +using ProjectBulldozer.Entities; + namespace ProjectBulldozer { internal class DrawningBulldozer diff --git a/ProjectBulldozer/Entities/EntityBulldozer.cs b/ProjectBulldozer/Entities/EntityBulldozer.cs new file mode 100644 index 0000000..f65c2a9 --- /dev/null +++ b/ProjectBulldozer/Entities/EntityBulldozer.cs @@ -0,0 +1,22 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace ProjectBulldozer.Entities +{ + public class EntityBulldozer : EntityTractor + { + public Color AdditionalColor { get; private set; } + public bool Otval { get; private set; } + public bool SeifBatteries { get; private set; } + public EntityBulldozer(int speed, double weight, Color bodyColor, Color additionalColor, bool otval, + bool seifBatteries) : base(speed, weight, bodyColor) + { + AdditionalColor = additionalColor; + Otval = otval; + SeifBatteries = seifBatteries; + } + } +} diff --git a/ProjectBulldozer/Entities/EntityTractor.cs b/ProjectBulldozer/Entities/EntityTractor.cs new file mode 100644 index 0000000..2db9318 --- /dev/null +++ b/ProjectBulldozer/Entities/EntityTractor.cs @@ -0,0 +1,22 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace ProjectBulldozer.Entities +{ + public class EntityTractor + { + public int Speed { get; private set; } + public double Weight { get; private set; } + public Color BodyColor { get; private set; } + public double Step => (double)Speed * 100 / Weight; + public EntityTractor(int speed, double weight, Color bodyColor) + { + Speed = speed; + Weight = weight; + BodyColor = bodyColor; + } + } +} diff --git a/ProjectBulldozer/EntityBulldozer.cs b/ProjectBulldozer/EntityBulldozer.cs deleted file mode 100644 index eb451d9..0000000 --- a/ProjectBulldozer/EntityBulldozer.cs +++ /dev/null @@ -1,43 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; - -namespace ProjectBulldozer -{ - public class EntityBulldozer - { - - - 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 AdditionalEngine { get; private set; } - public bool AdditionalCompartment { get; private set; } - public double Step => (double)Speed * 240 / Weight; - - - /// - /// Инициализация полей объекта-класса бульдозера - /// - /// Скорость - /// Вес бульдозера - /// Основной цвет - /// Дополнительный цвет - /// Признак наличия дополнительного катка - /// Признак наличия гусениц - public void Init(int speed, double weight, Color bodyColor, Color - additionalColor, bool additionalEngine, bool additionalCompartment) - { - Speed = speed; - Weight = weight; - BodyColor = bodyColor; - AdditionalEngine = additionalEngine; - AdditionalColor = additionalColor; - - AdditionalCompartment = additionalCompartment; - } - } -}