Исправления

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