Eliseev E.E. LabWork07 #8

Closed
ElEgEv wants to merge 10 commits from LabWork07 into LabWork06
3 changed files with 8 additions and 11 deletions
Showing only changes of commit f148e15e63 - Show all commits

View File

@ -34,9 +34,7 @@ namespace Airbus
//конструктор
public MapWithSetPlanesGeneric(int picWidth, int picHeight, U map)
{
int width = picWidth / _placeSizeWidth;
int height = picHeight / _placeSizeHeight;
_setPlanes = new SetPlanesGeneric<T>(width * height);
_setPlanes = new SetPlanesGeneric<T>(18);
_pictureWidth = picWidth;
_pictureHeight = picHeight;
_map = map;

View File

@ -1,4 +1,2 @@
MapsCollection
123|DesertStormMap|1000:750:Blue;
6543|StarWarsMap|1000:750:Red:Red:True:True;
9876|SimpleMap|1000:750:Lime;
123|DesertStormMap|1000:750:Blue;1000:750:Yellow;1000:750:Red;1000:750:Lime;1000:750:Red;1000:750:Yellow;1000:750:Black;1000:750:Red;1000:750:DeepPink;1000:750:Black;1000:750:Yellow;1000:750:White;1000:750:Red;1000:750:Gray;1000:750:Lime;1000:750:Black;1000:750:Blue;1000:750:DeepPink;

View File

@ -29,7 +29,13 @@ namespace Airbus
//добавление объекта в набор
public int Insert(T plane)
{
if (Count == _maxCount)
{
throw new StorageOverflowException(_maxCount);
}
if (Count + 1 <= _maxCount) return Insert(plane, 0);
else return -1;
}
@ -46,11 +52,6 @@ namespace Airbus
throw new ArgumentException($"Объект {plane} уже есть в наборе");
}
if(Count == _maxCount)
{
throw new StorageOverflowException(_maxCount);
}
_places.Insert(position, plane);
return position;