2023-11-23 01:37:55 +04:00
|
|
|
|
using ProjectBulldozer.Entities;
|
2023-11-30 02:09:48 +04:00
|
|
|
|
namespace ProjectBulldozer.Drawning
|
2023-11-23 01:37:55 +04:00
|
|
|
|
{
|
|
|
|
|
public class DrawingBulldozer : DrawingTractor
|
|
|
|
|
{
|
|
|
|
|
public DrawingBulldozer(int speed, double weight, Color bodyColor, Color additionalColor,
|
2023-12-13 17:38:05 +04:00
|
|
|
|
bool otval, bool thirdWheel, int width, int height) : base(speed, weight, bodyColor, width, height, 120, 110)
|
2023-11-23 01:37:55 +04:00
|
|
|
|
{
|
|
|
|
|
if (EntityTractor != null)
|
|
|
|
|
{
|
2023-12-13 17:38:05 +04:00
|
|
|
|
EntityTractor = new EntityBulldozer(speed, width, bodyColor, additionalColor, otval, thirdWheel);
|
2023-11-23 01:37:55 +04:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
public override void DrawTransport(Graphics g)
|
|
|
|
|
{
|
|
|
|
|
if (EntityTractor is not EntityBulldozer Bulldozer)
|
|
|
|
|
{
|
|
|
|
|
return;
|
|
|
|
|
}
|
2023-12-13 17:38:05 +04:00
|
|
|
|
|
2023-11-23 01:37:55 +04:00
|
|
|
|
Pen pen = new(Color.Black);
|
|
|
|
|
Brush blackBrush = new SolidBrush(Color.Black);
|
2023-11-30 02:09:48 +04:00
|
|
|
|
Brush additionalColor = new SolidBrush(Bulldozer.AdditionalColor);
|
2023-11-23 01:37:55 +04:00
|
|
|
|
Brush grayBrush = new SolidBrush(Color.Gray);
|
2023-12-13 17:38:05 +04:00
|
|
|
|
|
|
|
|
|
if (Bulldozer.Otval)
|
|
|
|
|
{
|
|
|
|
|
//otval
|
|
|
|
|
Point[] Otval =
|
|
|
|
|
{
|
2023-11-30 02:09:48 +04:00
|
|
|
|
new Point(_startPosX + 118, _startPosY + 50),
|
|
|
|
|
new Point(_startPosX + 148, _startPosY + 111),
|
|
|
|
|
new Point(_startPosX+ 118, _startPosY + 111),
|
2023-11-23 01:37:55 +04:00
|
|
|
|
};
|
2023-12-13 17:38:05 +04:00
|
|
|
|
g.FillPolygon(additionalColor, Otval);
|
|
|
|
|
g.DrawPolygon(pen, Otval);
|
|
|
|
|
}
|
2023-11-23 01:37:55 +04:00
|
|
|
|
//гусеницы
|
|
|
|
|
Brush gg = new SolidBrush(Color.LightGray);
|
2023-11-30 02:09:48 +04:00
|
|
|
|
g.FillEllipse(gg, _startPosX + 16, _startPosY + 65, 101, 63);
|
|
|
|
|
g.DrawEllipse(pen, _startPosX + 16, _startPosY + 65, 101, 63);
|
2023-12-13 17:38:05 +04:00
|
|
|
|
|
|
|
|
|
if (Bulldozer.ThirdWheel)
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
g.FillEllipse(grayBrush, _startPosX + 65, _startPosY + 100, 13, 13);
|
|
|
|
|
g.DrawEllipse(pen, _startPosX + 65, _startPosY + 100, 13, 13);
|
|
|
|
|
}
|
2023-11-23 01:37:55 +04:00
|
|
|
|
Point[] Ttt =
|
2023-12-13 17:38:05 +04:00
|
|
|
|
{
|
|
|
|
|
|
2023-11-30 02:09:48 +04:00
|
|
|
|
new Point(_startPosX + 16, _startPosY + 79),
|
|
|
|
|
new Point(_startPosX + 16, _startPosY + 120),
|
|
|
|
|
new Point(_startPosX, _startPosY + 48),
|
2023-11-23 01:37:55 +04:00
|
|
|
|
|
|
|
|
|
};
|
|
|
|
|
g.FillPolygon(blackBrush, Ttt);
|
|
|
|
|
g.DrawPolygon(pen, Ttt);
|
2023-12-13 17:38:05 +04:00
|
|
|
|
g.FillRectangle(blackBrush, _startPosX + 110, _startPosY + 60, 5, 10);
|
|
|
|
|
|
2023-11-23 01:37:55 +04:00
|
|
|
|
base.DrawTransport(g);
|
|
|
|
|
}
|
|
|
|
|
}
|
2023-11-30 02:09:48 +04:00
|
|
|
|
}
|