Сдача 7-й лабораторной.
This commit is contained in:
parent
46569d56d3
commit
f148e15e63
@ -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;
|
||||
|
@ -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;
|
||||
|
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user