Исправлены недочёты
This commit is contained in:
parent
47fdebab72
commit
e57859d3e1
@ -9,9 +9,6 @@ namespace Excavator.Drawnings;
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
public class DrawningExcavator : DrawningTrackedVehicle
|
public class DrawningExcavator : DrawningTrackedVehicle
|
||||||
{
|
{
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Конструктор
|
/// Конструктор
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@ -28,13 +25,6 @@ public class DrawningExcavator : DrawningTrackedVehicle
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
public override void DrawTransport(Graphics g)
|
public override void DrawTransport(Graphics g)
|
||||||
{
|
{
|
||||||
if (EntityTrackedVehicle == null || EntityTrackedVehicle is not EntityExcavator excavator || !_startPosX.HasValue || !_startPosY.HasValue)
|
if (EntityTrackedVehicle == null || EntityTrackedVehicle is not EntityExcavator excavator || !_startPosX.HasValue || !_startPosY.HasValue)
|
||||||
@ -53,22 +43,12 @@ public class DrawningExcavator : DrawningTrackedVehicle
|
|||||||
|
|
||||||
int bodyHeight = 90;
|
int bodyHeight = 90;
|
||||||
int cabineHeight = 40;
|
int cabineHeight = 40;
|
||||||
|
|
||||||
int bucketWidth = 30;
|
int bucketWidth = 30;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
int wheelsHeight = 40;
|
int wheelsHeight = 40;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
Pen bPen = new(Color.Black);
|
Pen bPen = new(Color.Black);
|
||||||
bPen.Width = 3;
|
bPen.Width = 3;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
_startPosX += 20;
|
_startPosX += 20;
|
||||||
base.DrawTransport(g);
|
base.DrawTransport(g);
|
||||||
_startPosX -= 20;
|
_startPosX -= 20;
|
||||||
@ -105,14 +85,6 @@ public class DrawningExcavator : DrawningTrackedVehicle
|
|||||||
_startPosX.Value + bucketWidth + bodyHeight + 30, _startPosY.Value + bodyHeight + wheelsHeight);
|
_startPosX.Value + bucketWidth + bodyHeight + 30, _startPosY.Value + bodyHeight + wheelsHeight);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1,4 +1,5 @@
|
|||||||
using Excavator.Entities;
|
using System.Drawing.Drawing2D;
|
||||||
|
using Excavator.Entities;
|
||||||
|
|
||||||
|
|
||||||
namespace Excavator.Drawnings;
|
namespace Excavator.Drawnings;
|
||||||
@ -146,11 +147,6 @@ public class DrawningTrackedVehicle
|
|||||||
return false;
|
return false;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Установка позиции
|
/// Установка позиции
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@ -217,7 +213,6 @@ public class DrawningTrackedVehicle
|
|||||||
return true;
|
return true;
|
||||||
// вправо
|
// вправо
|
||||||
case DirectionType.Right:
|
case DirectionType.Right:
|
||||||
//TODO прописать логику сдвига в право
|
|
||||||
|
|
||||||
if (_startPosX.Value + _drawningExcavatorWidth + EntityTrackedVehicle.Step < _pictureWidth)
|
if (_startPosX.Value + _drawningExcavatorWidth + EntityTrackedVehicle.Step < _pictureWidth)
|
||||||
{
|
{
|
||||||
@ -228,7 +223,6 @@ public class DrawningTrackedVehicle
|
|||||||
return true;
|
return true;
|
||||||
//вниз
|
//вниз
|
||||||
case DirectionType.Down:
|
case DirectionType.Down:
|
||||||
//TODO прописать логику сдвига в вниз
|
|
||||||
if (_startPosY.Value + _drawningExcavatorHeight + EntityTrackedVehicle.Step < _pictureHeight)
|
if (_startPosY.Value + _drawningExcavatorHeight + EntityTrackedVehicle.Step < _pictureHeight)
|
||||||
{
|
{
|
||||||
_startPosY += (int)EntityTrackedVehicle.Step;
|
_startPosY += (int)EntityTrackedVehicle.Step;
|
||||||
@ -255,18 +249,11 @@ public class DrawningTrackedVehicle
|
|||||||
return path;
|
return path;
|
||||||
}
|
}
|
||||||
|
|
||||||
// top left arc
|
|
||||||
path.AddArc(arc, 180, 90);
|
path.AddArc(arc, 180, 90);
|
||||||
|
|
||||||
// top right arc
|
|
||||||
arc.X = bounds.Right - diameter;
|
arc.X = bounds.Right - diameter;
|
||||||
path.AddArc(arc, 270, 90);
|
path.AddArc(arc, 270, 90);
|
||||||
|
|
||||||
// bottom right arc
|
|
||||||
arc.Y = bounds.Bottom - diameter;
|
arc.Y = bounds.Bottom - diameter;
|
||||||
path.AddArc(arc, 0, 90);
|
path.AddArc(arc, 0, 90);
|
||||||
|
|
||||||
// bottom left arc
|
|
||||||
arc.X = bounds.Left;
|
arc.X = bounds.Left;
|
||||||
path.AddArc(arc, 90, 90);
|
path.AddArc(arc, 90, 90);
|
||||||
|
|
||||||
@ -297,7 +284,7 @@ public class DrawningTrackedVehicle
|
|||||||
Brush brRed = new SolidBrush(Color.Red);
|
Brush brRed = new SolidBrush(Color.Red);
|
||||||
Brush brYellow = new SolidBrush(Color.Yellow);
|
Brush brYellow = new SolidBrush(Color.Yellow);
|
||||||
Brush brBlack = new SolidBrush(Color.Black);
|
Brush brBlack = new SolidBrush(Color.Black);
|
||||||
|
Brush bodycolor = new SolidBrush(EntityTrackedVehicle.BodyColor);
|
||||||
|
|
||||||
|
|
||||||
int bodyHeight = 90;
|
int bodyHeight = 90;
|
||||||
@ -314,7 +301,7 @@ public class DrawningTrackedVehicle
|
|||||||
|
|
||||||
//кузов
|
//кузов
|
||||||
g.DrawRectangle(pen, _startPosX.Value + bucketWidth, _startPosY.Value + cabineHeight, bodyHeight, bodyHeight - cabineHeight);
|
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);
|
g.DrawRectangle(pen, _startPosX.Value + bucketWidth + pipeOffsetX, _startPosY.Value + cabineHeight - pipeHeight, pipeWidth, pipeHeight);
|
||||||
@ -358,9 +345,6 @@ public class DrawningTrackedVehicle
|
|||||||
g.DrawEllipse(bPen, _startPosX.Value + bucketWidth + wheelsOffsetX + 28, _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 + 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);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user