From 3c43df8a4518f9c6f14592005190a5e7380f0f35 Mon Sep 17 00:00:00 2001 From: Evgeny Egov Date: Sat, 6 Jan 2024 19:42:32 +0400 Subject: [PATCH] =?UTF-8?q?=D1=87=D1=82=D0=BE=D0=B1=D1=8B=20=D0=BD=D0=B5?= =?UTF-8?q?=20=D1=80=D1=83=D0=B3=D0=B0=D0=BB=D0=BE=D1=81=D1=8C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../AbstractCompany.cs | 2 +- .../ListGenericObjects.cs | 23 +++++++++++++++++-- .../ProjectSportCar/Drawnings/DrawningCar.cs | 9 ++++++++ .../Drawnings/DrawningSportCar.cs | 11 ++++++++- .../Entities/EntitySportCar.cs | 11 +++++++++ 5 files changed, 52 insertions(+), 4 deletions(-) diff --git a/ProjectSportCar/ProjectSportCar/CollectionGenericObjects/AbstractCompany.cs b/ProjectSportCar/ProjectSportCar/CollectionGenericObjects/AbstractCompany.cs index 85edb53..0753208 100644 --- a/ProjectSportCar/ProjectSportCar/CollectionGenericObjects/AbstractCompany.cs +++ b/ProjectSportCar/ProjectSportCar/CollectionGenericObjects/AbstractCompany.cs @@ -48,7 +48,7 @@ public abstract class AbstractCompany _pictureWidth = picWidth; _pictureHeight = picHeight; _collection = collection; - _collection.SetMaxCount = GetMaxCount; + _collection.MaxCount = GetMaxCount; } /// diff --git a/ProjectSportCar/ProjectSportCar/CollectionGenericObjects/ListGenericObjects.cs b/ProjectSportCar/ProjectSportCar/CollectionGenericObjects/ListGenericObjects.cs index e6c0b2c..e8c5ae5 100644 --- a/ProjectSportCar/ProjectSportCar/CollectionGenericObjects/ListGenericObjects.cs +++ b/ProjectSportCar/ProjectSportCar/CollectionGenericObjects/ListGenericObjects.cs @@ -1,4 +1,5 @@ -namespace ProjectSportCar.CollectionGenericObjects; + +namespace ProjectSportCar.CollectionGenericObjects; /// /// Параметризованный набор объектов @@ -19,7 +20,20 @@ public class ListGenericObjects : ICollectionGenericObjects public int Count => _collection.Count; - public int SetMaxCount { set { if (value > 0) { _maxCount = value; } } } + public int MaxCount + { + get => _maxCount; + set + { + if (value > 0) + { + _maxCount = value; + } + } + } + + + public CollectionType GetCollectionType => throw new NotImplementedException(); /// /// Конструктор @@ -56,4 +70,9 @@ public class ListGenericObjects : ICollectionGenericObjects // TODO удаление объекта из списка return true; } + + public IEnumerable GetItems() + { + throw new NotImplementedException(); + } } \ No newline at end of file diff --git a/ProjectSportCar/ProjectSportCar/Drawnings/DrawningCar.cs b/ProjectSportCar/ProjectSportCar/Drawnings/DrawningCar.cs index 570b5b6..e3f5302 100644 --- a/ProjectSportCar/ProjectSportCar/Drawnings/DrawningCar.cs +++ b/ProjectSportCar/ProjectSportCar/Drawnings/DrawningCar.cs @@ -84,6 +84,15 @@ public class DrawningCar EntityCar = new EntityCar(speed, weight, bodyColor); } + /// + /// Конструктор + /// + /// Класс-сущность + public DrawningCar(EntityCar car) : this() + { + // TODO продумать логику + } + /// /// Конструктор для наследников /// diff --git a/ProjectSportCar/ProjectSportCar/Drawnings/DrawningSportCar.cs b/ProjectSportCar/ProjectSportCar/Drawnings/DrawningSportCar.cs index 9bf7210..59bc69b 100644 --- a/ProjectSportCar/ProjectSportCar/Drawnings/DrawningSportCar.cs +++ b/ProjectSportCar/ProjectSportCar/Drawnings/DrawningSportCar.cs @@ -20,7 +20,16 @@ public class DrawningSportCar : DrawningCar public DrawningSportCar(int speed, double weight, Color bodyColor, Color additionalColor, bool bodyKit, bool wing, bool sportLine) : base(110, 60) { EntityCar = new EntitySportCar(speed, weight, bodyColor, additionalColor, bodyKit, wing, sportLine); - } + } + + /// + /// Конструктор + /// + /// Класс-сущность + public DrawningSportCar(EntityCar car) : base(110, 60) + { + // TODO продумать логику + } public override void DrawTransport(Graphics g) { diff --git a/ProjectSportCar/ProjectSportCar/Entities/EntitySportCar.cs b/ProjectSportCar/ProjectSportCar/Entities/EntitySportCar.cs index 4972c1c..d039499 100644 --- a/ProjectSportCar/ProjectSportCar/Entities/EntitySportCar.cs +++ b/ProjectSportCar/ProjectSportCar/Entities/EntitySportCar.cs @@ -44,4 +44,15 @@ public class EntitySportCar : EntityCar } //TODO Прописать метод + + /// + /// Создание объекта из массива строк + /// + /// + /// + public static EntitySportCar? CreateEntitySportCar(string[] strs) + { + // TODO продумать логику + return null; + } } \ No newline at end of file