Eliseev E.E. LabWork07 #8

Closed
ElEgEv wants to merge 10 commits from LabWork07 into LabWork06
Showing only changes of commit 15553c9fdd - Show all commits

View File

@ -59,22 +59,15 @@ namespace Airbus
//удаление объекта из набора с конкретной позиции
public T Remove(int position)
{
if (position < _maxCount && position >= 0)
if (position >= Count || position < 0)
{
if (_places.ElementAt(position) != null)
{
T result = _places.ElementAt(position);
_places.RemoveAt(position);
return result;
}
throw new PlaneNotFoundException(position);
}
return null;
T result = _places[position];
_places.RemoveAt(position);
return result;
}
//получение объекта из набора по позиции