Доделана отрисовка артиллерий

This commit is contained in:
Сергей Полевой 2022-10-02 17:42:23 +04:00
parent ccd57fad9b
commit f803dc89dd

View File

@ -111,10 +111,17 @@ namespace Artilleries
private void DrawArtilleries(Graphics g) private void DrawArtilleries(Graphics g)
{ {
int width = _pictureWidth / _placeSizeWidth;
int height = _pictureHeight / _placeSizeHeight;
for (int i = 0; i < _setArtilleries.Count; i++) for (int i = 0; i < _setArtilleries.Count; i++)
{ {
// TODO установка позиции var artillery = _setArtilleries.Get(i);
_setArtilleries.Get(i)?.DrawingObject(g); if (artillery != null)
{
artillery.SetObject(i % width * _placeSizeWidth + 10, (height - 1 - i / width) * _placeSizeHeight + 10, _pictureWidth, _pictureHeight);
artillery.DrawingObject(g);
}
} }
} }
} }