From 6ae71d329ee824d9f1e6a0e0e075a2f213ab1a35 Mon Sep 17 00:00:00 2001 From: Evgeny Egov Date: Sat, 6 Jan 2024 21:25:10 +0400 Subject: [PATCH] =?UTF-8?q?=D0=BF=D1=80=D0=B0=D0=B2=D0=BA=D0=B8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../CollectionGenericObjects/ICollectionGenericObjects.cs | 4 ++-- .../CollectionGenericObjects/ListGenericObjects.cs | 8 ++------ .../CollectionGenericObjects/MassiveGenericObjects.cs | 5 +++-- 3 files changed, 7 insertions(+), 10 deletions(-) diff --git a/ProjectSportCar/ProjectSportCar/CollectionGenericObjects/ICollectionGenericObjects.cs b/ProjectSportCar/ProjectSportCar/CollectionGenericObjects/ICollectionGenericObjects.cs index fd644eb..35ae5c5 100644 --- a/ProjectSportCar/ProjectSportCar/CollectionGenericObjects/ICollectionGenericObjects.cs +++ b/ProjectSportCar/ProjectSportCar/CollectionGenericObjects/ICollectionGenericObjects.cs @@ -25,7 +25,7 @@ public interface ICollectionGenericObjects /// Добавляемый объект /// Cравнение двух объектов /// true - вставка прошла удачно, false - вставка не удалась - bool Insert(T obj, IEqualityComparer? comparer = null); + bool Insert(T obj, IEqualityComparer? comparer = null); /// /// Добавление объекта в коллекцию на конкретную позицию @@ -34,7 +34,7 @@ public interface ICollectionGenericObjects /// Позиция /// Cравнение двух объектов /// true - вставка прошла удачно, false - вставка не удалась - bool Insert(T obj, int position, IEqualityComparer? comparer = null); + bool Insert(T obj, int position, IEqualityComparer? comparer = null); /// /// Удаление объекта из коллекции с конкретной позиции diff --git a/ProjectSportCar/ProjectSportCar/CollectionGenericObjects/ListGenericObjects.cs b/ProjectSportCar/ProjectSportCar/CollectionGenericObjects/ListGenericObjects.cs index 541584f..a53135e 100644 --- a/ProjectSportCar/ProjectSportCar/CollectionGenericObjects/ListGenericObjects.cs +++ b/ProjectSportCar/ProjectSportCar/CollectionGenericObjects/ListGenericObjects.cs @@ -32,10 +32,6 @@ public class ListGenericObjects : ICollectionGenericObjects } - public CollectionType GetCollectionType => throw new NotImplementedException(); - - public int MaxCount { get => throw new NotImplementedException(); set => throw new NotImplementedException(); } - public CollectionType GetCollectionType => throw new NotImplementedException(); /// @@ -53,7 +49,7 @@ public class ListGenericObjects : ICollectionGenericObjects return _collection[position]; } - public bool Insert(T obj, IEqualityComparer? comparer = null) + public bool Insert(T obj, IEqualityComparer? comparer = null) { // TODO проверка, что не превышено максимальное количество элементов // TODO выброс ошибки, если переполнение @@ -61,7 +57,7 @@ public class ListGenericObjects : ICollectionGenericObjects return true; } - public bool Insert(T obj, int position, IEqualityComparer? comparer = null) + public bool Insert(T obj, int position, IEqualityComparer? comparer = null) { // TODO проверка, что не превышено максимальное количество элементов // TODO выброс ошибки, если переполнение diff --git a/ProjectSportCar/ProjectSportCar/CollectionGenericObjects/MassiveGenericObjects.cs b/ProjectSportCar/ProjectSportCar/CollectionGenericObjects/MassiveGenericObjects.cs index c6ff9d0..071898e 100644 --- a/ProjectSportCar/ProjectSportCar/CollectionGenericObjects/MassiveGenericObjects.cs +++ b/ProjectSportCar/ProjectSportCar/CollectionGenericObjects/MassiveGenericObjects.cs @@ -57,14 +57,15 @@ public class MassiveGenericObjects : ICollectionGenericObjects return _collection[position]; } - public bool Insert(T obj, IEqualityComparer? comparer = null) + public bool Insert(T obj, IEqualityComparer? comparer = null) { + // TODO выборс ошибки, если такой объект есть в коллекции // TODO вставка в свободное место набора // TODO выброс ошибки, если переполнение return false; } - public bool Insert(T obj, int position, IEqualityComparer? comparer = null) + public bool Insert(T obj, int position, IEqualityComparer? comparer = null) { // TODO выборс ошибки, если такой объект есть в коллекции // TODO проверка позиции