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;