Перерисовка локомотива

This commit is contained in:
Данил Лопатин 2024-04-15 17:25:50 +03:00
parent 63173ed478
commit 1d32aa0b0f
2 changed files with 21 additions and 17 deletions

View File

@ -33,7 +33,7 @@ public class DrawningLocomotive
/// <summary>
/// Высота прорисовки паровоза
/// </summary>
private readonly int _drawningLocomotiveHeight = 100;
private readonly int _drawningLocomotiveHeight = 70;
/// <summary>
/// Координата X объекта
@ -249,27 +249,27 @@ public class DrawningLocomotive
//локомотив
Brush br = new SolidBrush(EntityLocomotive.BodyColor);
Brush blBr = new SolidBrush(Color.Black);
g.DrawRectangle(pen, _startPosX.Value, _startPosY.Value + 60, 140, 20);
g.FillRectangle(br, _startPosX.Value, _startPosY.Value + 60, 140, 20);
Point point1 = new Point(_startPosX.Value, _startPosY.Value + 60);
Point point2 = new Point(_startPosX.Value + 20, _startPosY.Value + 30);
Point point3 = new Point(_startPosX.Value + 140, _startPosY.Value + 30);
Point point4 = new Point(_startPosX.Value + 140, _startPosY.Value + 60);
g.DrawRectangle(pen, _startPosX.Value, _startPosY.Value + 30, 140, 20);
g.FillRectangle(br, _startPosX.Value, _startPosY.Value + 30, 140, 20);
Point point1 = new Point(_startPosX.Value, _startPosY.Value + 30);
Point point2 = new Point(_startPosX.Value + 20, _startPosY.Value);
Point point3 = new Point(_startPosX.Value + 140, _startPosY.Value);
Point point4 = new Point(_startPosX.Value + 140, _startPosY.Value + 30);
Point[] body = { point1, point2, point3, point4 };
g.DrawPolygon(pen, body);
g.FillPolygon(br, body);
g.DrawRectangle(pen, _startPosX.Value + 140, _startPosY.Value + 40, 10, 40);
g.FillRectangle(br, _startPosX.Value + 140, _startPosY.Value + 40, 10, 40);
g.DrawRectangle(pen, _startPosX.Value + 140, _startPosY.Value + 10, 10, 40);
g.FillRectangle(br, _startPosX.Value + 140, _startPosY.Value + 10, 10, 40);
//колеса
g.DrawEllipse(pen, _startPosX.Value, _startPosY.Value + 80, 20, 20);
g.FillEllipse(blBr, _startPosX.Value, _startPosY.Value + 80, 20, 20);
g.DrawEllipse(pen, _startPosX.Value + 30, _startPosY.Value + 80, 20, 20);
g.FillEllipse(blBr, _startPosX.Value + 30, _startPosY.Value + 80, 20, 20);
g.DrawEllipse(pen, _startPosX.Value + 90, _startPosY.Value + 80, 20, 20);
g.FillEllipse(blBr, _startPosX.Value + 90, _startPosY.Value + 80, 20, 20);
g.DrawEllipse(pen, _startPosX.Value + 120, _startPosY.Value + 80, 20, 20);
g.FillEllipse(blBr, _startPosX.Value + 120, _startPosY.Value + 80, 20, 20);
g.DrawEllipse(pen, _startPosX.Value, _startPosY.Value + 50, 20, 20);
g.FillEllipse(blBr, _startPosX.Value, _startPosY.Value + 50, 20, 20);
g.DrawEllipse(pen, _startPosX.Value + 30, _startPosY.Value + 50, 20, 20);
g.FillEllipse(blBr, _startPosX.Value + 30, _startPosY.Value + 50, 20, 20);
g.DrawEllipse(pen, _startPosX.Value + 90, _startPosY.Value + 50, 20, 20);
g.FillEllipse(blBr, _startPosX.Value + 90, _startPosY.Value + 50, 20, 20);
g.DrawEllipse(pen, _startPosX.Value + 120, _startPosY.Value + 50, 20, 20);
g.FillEllipse(blBr, _startPosX.Value + 120, _startPosY.Value + 50, 20, 20);
// отсек для топлива
//if (EntityWarmlyLocomotive.FuelTank)

View File

@ -32,6 +32,9 @@ public class DrawningWarmlyLocomotive : DrawningLocomotive
g.FillRectangle(additionalBrush, _startPosX.Value + 40, _startPosY.Value, 20, 40);
}
_startPosY += 30;
base.DrawTransport(g);
_startPosY -= 30;
// отсек для топлива
if (warmlyLocomotive.FuelTank)
@ -39,6 +42,7 @@ public class DrawningWarmlyLocomotive : DrawningLocomotive
g.DrawRectangle(pen, _startPosX.Value + 80, _startPosY.Value + 40, 50, 40);
g.FillRectangle(additionalBrush, _startPosX.Value + 80, _startPosY.Value + 40, 50, 40);
}
}
}