Dolgov D.A. Lab Work 7 #7
@ -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>
|
||||
/// Удаление объекта из набора с конкретной позиции
|
||||
|
Loading…
Reference in New Issue
Block a user