Sorokin P.V. Lab work 3 #3

Merged
eegov merged 4 commits from LabWork03 into LabWork02 2022-10-21 08:51:31 +04:00
Showing only changes of commit c8a7dece5b - Show all commits

View File

@ -25,9 +25,9 @@ namespace Liner
_pictureHeight = picHeight;
_map = map;
}
public static bool operator +(MapWithSetShipsGeneric<T, U> map, T car)
public static bool operator +(MapWithSetShipsGeneric<T, U> map, T ship)
{
if (map._setShips.Insert(car) == -1)
if (map._setShips.Insert(ship) == -1)
{
return false;
}
@ -52,7 +52,7 @@ namespace Liner
Bitmap bmp = new(_pictureWidth, _pictureHeight);
Graphics gr = Graphics.FromImage(bmp);
DrawBackground(gr);
DrawCars(gr);
DrawShips(gr);
return bmp;
}
public Bitmap ShowOnMap()
@ -115,7 +115,7 @@ namespace Liner
g.DrawLine(pen, i * _placeSizeWidth - 4, 0, i * _placeSizeWidth - 4, (_pictureHeight / _placeSizeHeight) * _placeSizeHeight);
}
}
private void DrawCars(Graphics g)
private void DrawShips(Graphics g)
{
int widthEl = _pictureWidth / _placeSizeWidth;
int heightEl = _pictureHeight / _placeSizeHeight;