diff --git a/Excavator/Excavator/Drawnings/DrawningExcavator.cs b/Excavator/Excavator/Drawnings/DrawningExcavator.cs
index 53fcb16..79b2753 100644
--- a/Excavator/Excavator/Drawnings/DrawningExcavator.cs
+++ b/Excavator/Excavator/Drawnings/DrawningExcavator.cs
@@ -9,9 +9,6 @@ namespace Excavator.Drawnings;
///
public class DrawningExcavator : DrawningTrackedVehicle
{
-
-
-
///
/// Конструктор
///
@@ -28,13 +25,6 @@ public class DrawningExcavator : DrawningTrackedVehicle
}
-
-
-
-
-
-
-
public override void DrawTransport(Graphics g)
{
if (EntityTrackedVehicle == null || EntityTrackedVehicle is not EntityExcavator excavator || !_startPosX.HasValue || !_startPosY.HasValue)
@@ -53,22 +43,12 @@ public class DrawningExcavator : DrawningTrackedVehicle
int bodyHeight = 90;
int cabineHeight = 40;
-
int bucketWidth = 30;
-
-
-
-
-
int wheelsHeight = 40;
-
-
Pen bPen = new(Color.Black);
bPen.Width = 3;
-
-
_startPosX += 20;
base.DrawTransport(g);
_startPosX -= 20;
@@ -104,15 +84,7 @@ public class DrawningExcavator : DrawningTrackedVehicle
_startPosX.Value + bucketWidth + bodyHeight + 15, _startPosY.Value + bodyHeight + wheelsHeight,
_startPosX.Value + bucketWidth + bodyHeight + 30, _startPosY.Value + bodyHeight + wheelsHeight);
}
-
-
-
-
- }
-
-
-
-
+ }
}
diff --git a/Excavator/Excavator/Drawnings/DrawningTrackedVehicle.cs b/Excavator/Excavator/Drawnings/DrawningTrackedVehicle.cs
index b90ffe6..01a7b28 100644
--- a/Excavator/Excavator/Drawnings/DrawningTrackedVehicle.cs
+++ b/Excavator/Excavator/Drawnings/DrawningTrackedVehicle.cs
@@ -1,4 +1,5 @@
-using Excavator.Entities;
+using System.Drawing.Drawing2D;
+using Excavator.Entities;
namespace Excavator.Drawnings;
@@ -146,11 +147,6 @@ public class DrawningTrackedVehicle
return false;
}
-
-
-
-
-
///
/// Установка позиции
///
@@ -217,7 +213,6 @@ public class DrawningTrackedVehicle
return true;
// вправо
case DirectionType.Right:
- //TODO прописать логику сдвига в право
if (_startPosX.Value + _drawningExcavatorWidth + EntityTrackedVehicle.Step < _pictureWidth)
{
@@ -228,7 +223,6 @@ public class DrawningTrackedVehicle
return true;
//вниз
case DirectionType.Down:
- //TODO прописать логику сдвига в вниз
if (_startPosY.Value + _drawningExcavatorHeight + EntityTrackedVehicle.Step < _pictureHeight)
{
_startPosY += (int)EntityTrackedVehicle.Step;
@@ -255,18 +249,11 @@ public class DrawningTrackedVehicle
return path;
}
- // top left arc
- path.AddArc(arc, 180, 90);
-
- // top right arc
+ path.AddArc(arc, 180, 90);
arc.X = bounds.Right - diameter;
path.AddArc(arc, 270, 90);
-
- // bottom right arc
arc.Y = bounds.Bottom - diameter;
path.AddArc(arc, 0, 90);
-
- // bottom left arc
arc.X = bounds.Left;
path.AddArc(arc, 90, 90);
@@ -297,8 +284,8 @@ public class DrawningTrackedVehicle
Brush brRed = new SolidBrush(Color.Red);
Brush brYellow = new SolidBrush(Color.Yellow);
Brush brBlack = new SolidBrush(Color.Black);
+ Brush bodycolor = new SolidBrush(EntityTrackedVehicle.BodyColor);
-
int bodyHeight = 90;
int cabineHeight = 40;
@@ -314,7 +301,7 @@ public class DrawningTrackedVehicle
//кузов
g.DrawRectangle(pen, _startPosX.Value + bucketWidth, _startPosY.Value + cabineHeight, bodyHeight, bodyHeight - cabineHeight);
- g.FillRectangle(brGray, _startPosX.Value + bucketWidth, _startPosY.Value + cabineHeight, bodyHeight, bodyHeight - cabineHeight);
+ g.FillRectangle(bodycolor, _startPosX.Value + bucketWidth, _startPosY.Value + cabineHeight, bodyHeight, bodyHeight - cabineHeight);
//труба
g.DrawRectangle(pen, _startPosX.Value + bucketWidth + pipeOffsetX, _startPosY.Value + cabineHeight - pipeHeight, pipeWidth, pipeHeight);
@@ -357,10 +344,7 @@ public class DrawningTrackedVehicle
g.DrawEllipse(bPen, _startPosX.Value + bucketWidth + wheelsOffsetX + 13, _startPosY.Value + bodyHeight + wheelsHeight / 6, 9, 9);
g.DrawEllipse(bPen, _startPosX.Value + bucketWidth + wheelsOffsetX + 28, _startPosY.Value + bodyHeight + wheelsHeight / 6, 9, 9);
g.FillEllipse(brYellow, _startPosX.Value + bucketWidth + wheelsOffsetX + 13, _startPosY.Value + bodyHeight + wheelsHeight / 6, 9, 9);
- g.FillEllipse(brYellow, _startPosX.Value + bucketWidth + wheelsOffsetX + 28, _startPosY.Value + bodyHeight + wheelsHeight / 6, 9, 9);
-
-
-
+ g.FillEllipse(brYellow, _startPosX.Value + bucketWidth + wheelsOffsetX + 28, _startPosY.Value + bodyHeight + wheelsHeight / 6, 9, 9);
}
}