Dolgov D.A. Lab Work 3 #3
@ -69,6 +69,7 @@ namespace ProjectPlane
|
||||
{
|
||||
return map._setPlanes.Remove(position);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Вывод всего набора объектов
|
||||
/// </summary>
|
||||
@ -165,21 +166,26 @@ namespace ProjectPlane
|
||||
/// <param name="g"></param>
|
||||
private void DrawPlanes(Graphics g)
|
||||
{
|
||||
int width = _pictureWidth / _placeSizeWidth;
|
||||
int width = _pictureWidth / _placeSizeWidth - 1;
|
||||
int height = _pictureHeight / _placeSizeHeight - 1;
|
||||
|
||||
int curWidth = 0;
|
||||
int curHeight = 0;
|
||||
for (int i = 0; i < _setPlanes.Count; i++)
|
||||
{
|
||||
_setPlanes.Get(i)?.SetObject(curWidth * _placeSizeWidth + 10, curHeight * _placeSizeHeight + 15, _pictureWidth, _pictureHeight);
|
||||
_setPlanes.Get(i)?.SetObject((width) * _placeSizeWidth + 10, (height) * _placeSizeHeight + 15, _pictureWidth, _pictureHeight);
|
||||
_setPlanes.Get(i)?.DrawingObject(g);
|
||||
|
||||
if (width <= 0)
|
||||
{
|
||||
width = _pictureWidth / _placeSizeWidth - 1;
|
||||
height--;
|
||||
}
|
||||
else
|
||||
{
|
||||
width--;
|
||||
|
||||
}
|
||||
}
|
||||
if (curWidth < width) curWidth++;
|
||||
else
|
||||
{
|
||||
curWidth = 0;
|
||||
curHeight++;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user