From 179f5b9b943818025526b48fbfcf2af60f539836 Mon Sep 17 00:00:00 2001 From: F1rsTTeaM Date: Sun, 14 Apr 2024 12:27:49 +0400 Subject: [PATCH] =?UTF-8?q?=D0=A1=D0=BC=D0=B5=D0=BD=D0=B0=20=D0=BC=D0=B5?= =?UTF-8?q?=D1=81=D1=82=D0=B0=D0=BC=D0=B8=20get=20=D0=B8=20set?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../CollectionGenericObjects/ListGenericObjects.cs | 13 +++++++------ .../MassiveGenericObjects.cs | 12 ++++++------ 2 files changed, 13 insertions(+), 12 deletions(-) diff --git a/AirplaneWithRadar/ProjectAirplaneWithRadar/CollectionGenericObjects/ListGenericObjects.cs b/AirplaneWithRadar/ProjectAirplaneWithRadar/CollectionGenericObjects/ListGenericObjects.cs index 3313fb3..8463540 100644 --- a/AirplaneWithRadar/ProjectAirplaneWithRadar/CollectionGenericObjects/ListGenericObjects.cs +++ b/AirplaneWithRadar/ProjectAirplaneWithRadar/CollectionGenericObjects/ListGenericObjects.cs @@ -20,18 +20,19 @@ namespace ProjectAirplaneWithRadar.CollectionGenericObjects public int Count => _collection.Count; - public int MaxCount { + public int MaxCount { + get + { + return _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 6b87964..0f4dfab 100644 --- a/AirplaneWithRadar/ProjectAirplaneWithRadar/CollectionGenericObjects/MassiveGenericObjects.cs +++ b/AirplaneWithRadar/ProjectAirplaneWithRadar/CollectionGenericObjects/MassiveGenericObjects.cs @@ -17,6 +17,11 @@ namespace ProjectAirplaneWithRadar.CollectionGenericObjects public int MaxCount { + get + { + return _collection.Length; + } + set { if (value > 0) @@ -30,12 +35,7 @@ namespace ProjectAirplaneWithRadar.CollectionGenericObjects _collection = new T?[value]; } } - } - - get - { - return _collection.Length; - } + } } public CollectionType GetCollectionType => CollectionType.Massive;