From ac10e0d6e7cf49957f59e2491a2c5c90cf5467bd Mon Sep 17 00:00:00 2001 From: F1rsTTeaM Date: Sun, 14 Apr 2024 12:25:50 +0400 Subject: [PATCH] =?UTF-8?q?=D0=98=D0=B7=D0=BC=D0=B5=D0=BD=D0=B5=D0=BD?= =?UTF-8?q?=D0=B8=D0=B5=20SetMaxCount=20=D0=BD=D0=B0=20MaxCount?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../ICollectionGenericObjects.cs | 2 +- .../CollectionGenericObjects/ListGenericObjects.cs | 14 +++++++++++++- .../MassiveGenericObjects.cs | 7 ++++++- 3 files changed, 20 insertions(+), 3 deletions(-) diff --git a/AirplaneWithRadar/ProjectAirplaneWithRadar/CollectionGenericObjects/ICollectionGenericObjects.cs b/AirplaneWithRadar/ProjectAirplaneWithRadar/CollectionGenericObjects/ICollectionGenericObjects.cs index d0b1a69..be6574b 100644 --- a/AirplaneWithRadar/ProjectAirplaneWithRadar/CollectionGenericObjects/ICollectionGenericObjects.cs +++ b/AirplaneWithRadar/ProjectAirplaneWithRadar/CollectionGenericObjects/ICollectionGenericObjects.cs @@ -17,7 +17,7 @@ namespace ProjectAirplaneWithRadar.CollectionGenericObjects /// /// Установка максимального количества элементов /// - int SetMaxCount { set; } + int MaxCount { get; set; } /// /// Добавление объекта в коллекцию diff --git a/AirplaneWithRadar/ProjectAirplaneWithRadar/CollectionGenericObjects/ListGenericObjects.cs b/AirplaneWithRadar/ProjectAirplaneWithRadar/CollectionGenericObjects/ListGenericObjects.cs index 5f75759..3313fb3 100644 --- a/AirplaneWithRadar/ProjectAirplaneWithRadar/CollectionGenericObjects/ListGenericObjects.cs +++ b/AirplaneWithRadar/ProjectAirplaneWithRadar/CollectionGenericObjects/ListGenericObjects.cs @@ -20,7 +20,19 @@ namespace ProjectAirplaneWithRadar.CollectionGenericObjects public int Count => _collection.Count; - public int SetMaxCount { set { if (value > 0) { _maxCount = value; } } } + public int MaxCount { + set + { + if (value > 0) + { + _maxCount = value; + } + } + get + { + return _maxCount; + } + } public CollectionType GetCollectionType => CollectionType.List; diff --git a/AirplaneWithRadar/ProjectAirplaneWithRadar/CollectionGenericObjects/MassiveGenericObjects.cs b/AirplaneWithRadar/ProjectAirplaneWithRadar/CollectionGenericObjects/MassiveGenericObjects.cs index dd5804a..6b87964 100644 --- a/AirplaneWithRadar/ProjectAirplaneWithRadar/CollectionGenericObjects/MassiveGenericObjects.cs +++ b/AirplaneWithRadar/ProjectAirplaneWithRadar/CollectionGenericObjects/MassiveGenericObjects.cs @@ -15,7 +15,7 @@ namespace ProjectAirplaneWithRadar.CollectionGenericObjects public int Count => _collection.Length; - public int SetMaxCount + public int MaxCount { set { @@ -31,6 +31,11 @@ namespace ProjectAirplaneWithRadar.CollectionGenericObjects } } } + + get + { + return _collection.Length; + } } public CollectionType GetCollectionType => CollectionType.Massive;