Abazov A. A. LabWork04 #4

Merged
eegov merged 5 commits from LabWork04 into LabWork03 2022-10-28 09:46:46 +04:00
Showing only changes of commit 38d73a94a7 - Show all commits

View File

@ -36,7 +36,7 @@ namespace AirBomber
/// <returns></returns>
public int Insert(T airBomber)
{
if (_places.Count >= _maxCount) return -1;
if (_places.Count + 1 >= _maxCount) return -1;
_places.Insert(0, airBomber);
return 0;
}
@ -49,7 +49,7 @@ namespace AirBomber
public int Insert(T airBomber, int position)
{
if (position < 0 || position >= _maxCount) return -1;
if (_places.Count >= _maxCount) return -1;
if (_places.Count + 1 >= _maxCount) return -1;
_places.Insert(position, airBomber);
return position;
}