Исправления

This commit is contained in:
the 2022-10-11 10:38:13 +04:00
parent eae54734e1
commit 45aa67a6bc

View File

@ -80,7 +80,7 @@ namespace Ship
Bitmap bmp = new(_pictureWidth, _pictureHeight);
Graphics gr = Graphics.FromImage(bmp);
DrawBackground(gr);
DrawCars(gr);
DrawShips(gr);
return bmp;
}
/// <summary>
@ -169,18 +169,18 @@ namespace Ship
/// Метод прорисовки объектов
/// </summary>
/// <param name="g"></param>
private void DrawCars(Graphics g)
private void DrawShips(Graphics g)
{
int width = _pictureWidth / _placeSizeWidth;
int height = _pictureHeight / _placeSizeHeight;
for (int i = 0; i < _setShips.Count; i++)
{
var artillery = _setShips.Get(i);
if (artillery != null)
var ship = _setShips.Get(i);
if (ship != null)
{
artillery.SetObject((width - i % width - 1) * _placeSizeWidth + 10, (i / width) * _placeSizeHeight + 10, _pictureWidth, _pictureHeight);
artillery.DrawningObject(g);
ship.SetObject((width - i % width - 1) * _placeSizeWidth + 10, (i / width) * _placeSizeHeight + 10, _pictureWidth, _pictureHeight);
ship.DrawningObject(g);
}
}
}