Смена местами get и set

This commit is contained in:
Павел Ладягин 2024-04-14 12:27:49 +04:00
parent ac10e0d6e7
commit 179f5b9b94
2 changed files with 13 additions and 12 deletions

View File

@ -20,18 +20,19 @@ namespace ProjectAirplaneWithRadar.CollectionGenericObjects
public int Count => _collection.Count; public int Count => _collection.Count;
public int MaxCount { public int MaxCount {
get
{
return _maxCount;
}
set set
{ {
if (value > 0) if (value > 0)
{ {
_maxCount = value; _maxCount = value;
} }
} }
get
{
return _maxCount;
}
} }
public CollectionType GetCollectionType => CollectionType.List; public CollectionType GetCollectionType => CollectionType.List;

View File

@ -17,6 +17,11 @@ namespace ProjectAirplaneWithRadar.CollectionGenericObjects
public int MaxCount public int MaxCount
{ {
get
{
return _collection.Length;
}
set set
{ {
if (value > 0) if (value > 0)
@ -30,12 +35,7 @@ namespace ProjectAirplaneWithRadar.CollectionGenericObjects
_collection = new T?[value]; _collection = new T?[value];
} }
} }
} }
get
{
return _collection.Length;
}
} }
public CollectionType GetCollectionType => CollectionType.Massive; public CollectionType GetCollectionType => CollectionType.Massive;