Изменение SetMaxCount на MaxCount

This commit is contained in:
Павел Ладягин 2024-04-14 12:25:50 +04:00
parent 75ec5da6bd
commit ac10e0d6e7
3 changed files with 20 additions and 3 deletions

View File

@ -17,7 +17,7 @@ namespace ProjectAirplaneWithRadar.CollectionGenericObjects
/// <summary> /// <summary>
/// Установка максимального количества элементов /// Установка максимального количества элементов
/// </summary> /// </summary>
int SetMaxCount { set; } int MaxCount { get; set; }
/// <summary> /// <summary>
/// Добавление объекта в коллекцию /// Добавление объекта в коллекцию

View File

@ -20,7 +20,19 @@ namespace ProjectAirplaneWithRadar.CollectionGenericObjects
public int Count => _collection.Count; 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; public CollectionType GetCollectionType => CollectionType.List;

View File

@ -15,7 +15,7 @@ namespace ProjectAirplaneWithRadar.CollectionGenericObjects
public int Count => _collection.Length; public int Count => _collection.Length;
public int SetMaxCount public int MaxCount
{ {
set set
{ {
@ -31,6 +31,11 @@ namespace ProjectAirplaneWithRadar.CollectionGenericObjects
} }
} }
} }
get
{
return _collection.Length;
}
} }
public CollectionType GetCollectionType => CollectionType.Massive; public CollectionType GetCollectionType => CollectionType.Massive;