Лаба 5 готова.

This commit is contained in:
Андрей Байгулов 2023-11-12 23:38:39 +04:00
parent 15f09ac242
commit a258fe0f84

View File

@ -30,6 +30,7 @@ namespace ProjectElectricLocomotive.DrawingObjects
Brush additionalBrush = new SolidBrush(electricLocomotive.AdditionalColor); Brush additionalBrush = new SolidBrush(electricLocomotive.AdditionalColor);
Brush bodyColor = new SolidBrush(electricLocomotive.BodyColor); Brush bodyColor = new SolidBrush(electricLocomotive.BodyColor);
g.DrawRectangle(pen, _startPosX + 40, _startPosY + 24, 25, 11); g.DrawRectangle(pen, _startPosX + 40, _startPosY + 24, 25, 11);
if (electricLocomotive.Compartment)
g.FillPolygon(additionalBrush, new Point[] g.FillPolygon(additionalBrush, new Point[]
{ {
new Point(_startPosX + 61, _startPosY + 25), new Point(_startPosX + 61, _startPosY + 25),
@ -39,10 +40,12 @@ namespace ProjectElectricLocomotive.DrawingObjects
new Point(_startPosX + 61, _startPosY + 25), new Point(_startPosX + 61, _startPosY + 25),
} }
); );
if (electricLocomotive.Pantograph)
{
g.FillRectangle(blackBrush, _startPosX + 30, _startPosY + 15, 20, 5); g.FillRectangle(blackBrush, _startPosX + 30, _startPosY + 15, 20, 5);
g.DrawLine(pen, _startPosX + 30, _startPosY + 15, _startPosX + 50, _startPosY + 2); g.DrawLine(pen, _startPosX + 30, _startPosY + 15, _startPosX + 50, _startPosY + 2);
g.DrawLine(pen, _startPosX + 40, _startPosY + 15, _startPosX + 60, _startPosY + 2); g.DrawLine(pen, _startPosX + 40, _startPosY + 15, _startPosX + 60, _startPosY + 2);
}
base.DrawTransport(g); base.DrawTransport(g);
} }
public void SetAdditionalColor(Color color) public void SetAdditionalColor(Color color)