Изменил(а) на 'ProjectPlane/ProjectPlane/SetPlanesGeneric.cs'

This commit is contained in:
devil_1nc 2022-11-22 16:46:49 +04:00
parent 6977781923
commit c920e6c1d5

View File

@ -43,9 +43,12 @@ namespace ProjectPlane
/// <returns></returns>
public int Insert(T plane, int position)
{
if (position < 0 || position >= _maxCount) throw new StorageOverflowException(_maxCount);
if (Count == _maxCount) throw new StorageOverflowException(_maxCount);
if (position < 0 || position >= _maxCount) return -1;
_places.Insert(position, plane);
return position;
}
/// <summary>
/// Удаление объекта из набора с конкретной позиции