PIbd-21 Potapov N.S. LabWork07 #7

Closed
ns.potapov wants to merge 12 commits from LabWork07 into LabWork06
Showing only changes of commit 9bb3eb73a4 - Show all commits

View File

@ -71,17 +71,17 @@ namespace ProjectStormtrooper
public T? Remove(int position)
{
// Проверка позиции
if (position < 0 || position >= Count)
if (position < 0 || position >= _maxCount)
{
return null;
}
// Удаление объекта из массива, присвоив элементу массива значение null
T? plane = _places[position];
if (plane == null)
if (position >= Count && position < _maxCount)
{
throw new PlaneNotFoundException(position);
}
_places[position] = null;
// Удаление объекта из массива, присвоив элементу массива значение null
T? plane = _places[position];
_places.RemoveAt(position);
return plane;
}
/// <summary>