From 5ed8caf82cdf76ca00d4aa24de957cedaf4c7fa2 Mon Sep 17 00:00:00 2001 From: spacyboy Date: Wed, 22 Nov 2023 03:50:40 +0400 Subject: [PATCH] =?UTF-8?q?=D0=B3=D0=BE=D1=82=D0=BE=D0=B2=D0=B0=D1=8F=20la?= =?UTF-8?q?ba=5F2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- RoadTrain/RoadTrain/AbstractStrategy.cs | 2 +- RoadTrain/RoadTrain/DrawingRoadTrain.cs | 26 +++++++++---------- .../RoadTrain/DrawingRoadTrainWithTank.cs | 12 ++++----- RoadTrain/RoadTrain/MoveToBorder.cs | 1 - RoadTrain/RoadTrain/RoadTrain.cs | 2 +- 5 files changed, 20 insertions(+), 23 deletions(-) diff --git a/RoadTrain/RoadTrain/AbstractStrategy.cs b/RoadTrain/RoadTrain/AbstractStrategy.cs index abeb132..0f9904d 100644 --- a/RoadTrain/RoadTrain/AbstractStrategy.cs +++ b/RoadTrain/RoadTrain/AbstractStrategy.cs @@ -68,4 +68,4 @@ namespace RoadTrain.MovementStrategy return false; } } -} +} \ No newline at end of file diff --git a/RoadTrain/RoadTrain/DrawingRoadTrain.cs b/RoadTrain/RoadTrain/DrawingRoadTrain.cs index 8fa1443..d9a9e52 100644 --- a/RoadTrain/RoadTrain/DrawingRoadTrain.cs +++ b/RoadTrain/RoadTrain/DrawingRoadTrain.cs @@ -103,21 +103,19 @@ namespace RoadTrain.DrawingObjects Brush bodyBrush = new SolidBrush(EntityRoadTrain.BodyColor); Brush whiteBrush = new SolidBrush(Color.White); - - //машина - g.DrawRectangle(pen, _startPosX - 20, _startPosY + 50 + 80, 160, 20); - g.FillRectangle(bodyBrush, _startPosX - 20, _startPosY + 50 + 80, 160, 20); - g.DrawEllipse(pen, _startPosX + 5 - 20, _startPosY + 70 + 80, 30, 30); //колесо - g.FillEllipse(bodyBrush, _startPosX + 5 - 20, _startPosY + 70 + 80, 30, 30); - g.DrawEllipse(pen, _startPosX + 40 - 20, _startPosY + 70 + 80, 30, 30); //колесо - g.FillEllipse(bodyBrush, _startPosX + 40 - 20, _startPosY + 70 + 80, 30, 30); - g.DrawEllipse(pen, _startPosX + 120 - 20, _startPosY + 70 + 80, 30, 30); //колесо - g.FillEllipse(bodyBrush, _startPosX + 120 - 20, _startPosY + 70 + 80, 30, 30); - g.DrawRectangle(pen, _startPosX + 120 - 20, _startPosY + 10 + 80, 40, 40); //кабина - g.FillRectangle(bodyBrush, _startPosX + 120 - 20, _startPosY + 10 + 80, 40, 40); - g.DrawRectangle(pen, _startPosX + 130 - 20, _startPosY + 20 + 80, 30, 20); //окно - g.FillRectangle(whiteBrush, _startPosX + 130 - 20, _startPosY + 20 + 80, 30, 20); + g.DrawRectangle(pen, _startPosX, _startPosY + 50, 160, 20); + g.FillRectangle(bodyBrush, _startPosX, _startPosY + 50, 160, 20); + g.DrawEllipse(pen, _startPosX + 5, _startPosY + 70, 30, 30); //колесо + g.FillEllipse(bodyBrush, _startPosX + 5, _startPosY + 70 , 30, 30); + g.DrawEllipse(pen, _startPosX + 40, _startPosY + 70, 30, 30); //колесо + g.FillEllipse(bodyBrush, _startPosX + 40, _startPosY + 70, 30, 30); + g.DrawEllipse(pen, _startPosX + 120, _startPosY + 70, 30, 30); //колесо + g.FillEllipse(bodyBrush, _startPosX + 120, _startPosY + 70, 30, 30); + g.DrawRectangle(pen, _startPosX + 120, _startPosY + 10, 40, 40); //кабина + g.FillRectangle(bodyBrush, _startPosX + 120, _startPosY + 10, 40, 40); + g.DrawRectangle(pen, _startPosX + 130, _startPosY + 20, 30, 20); //окно + g.FillRectangle(whiteBrush, _startPosX + 130, _startPosY + 20, 30, 20); } } diff --git a/RoadTrain/RoadTrain/DrawingRoadTrainWithTank.cs b/RoadTrain/RoadTrain/DrawingRoadTrainWithTank.cs index 4101ec0..de32d6a 100644 --- a/RoadTrain/RoadTrain/DrawingRoadTrainWithTank.cs +++ b/RoadTrain/RoadTrain/DrawingRoadTrainWithTank.cs @@ -12,7 +12,7 @@ namespace RoadTrain.DrawingObjects { public DrawingRoadTrainWithTank(int speed, double weight, Color bodyColor, Color additionalColor, bool pipes, bool section, int width, int height) - : base(speed, weight, bodyColor, width, height, 185, 180) + : base(speed, weight, bodyColor, width, height, 200, 100) { if (EntityRoadTrain != null) { @@ -34,15 +34,15 @@ namespace RoadTrain.DrawingObjects Brush brGray = new SolidBrush(Color.Gray); if (roadTrain.Brush) { - g.DrawLine(pen, _startPosX + 160-20, _startPosY + 70 + 80, _startPosX + 180, _startPosY + 80 + 80); - g.DrawRectangle(pen, _startPosX + 170-20, _startPosY + 80 + 80, 40, 10); //щетка - g.FillRectangle(additionalBrush, _startPosX + 170-20, _startPosY + 80 + 80, 40, 10); + g.DrawLine(pen, _startPosX + 160, _startPosY + 70, _startPosX + 180, _startPosY + 80); + g.DrawRectangle(pen, _startPosX + 170, _startPosY + 80, 40, 10); //щетка + g.FillRectangle(additionalBrush, _startPosX + 170, _startPosY + 80, 40, 10); } //бак if (roadTrain.Tank) { - g.DrawRectangle(pen, _startPosX + 10 - 20, _startPosY + 80, 90, 50); //бак с водой - g.FillRectangle(additionalBrush, _startPosX + 10-20, _startPosY + 80, 90, 50); + g.DrawRectangle(pen, _startPosX + 10, _startPosY, 90, 50); //бак с водой + g.FillRectangle(additionalBrush, _startPosX + 10, _startPosY, 90, 50); } } } diff --git a/RoadTrain/RoadTrain/MoveToBorder.cs b/RoadTrain/RoadTrain/MoveToBorder.cs index 22621b2..120bac0 100644 --- a/RoadTrain/RoadTrain/MoveToBorder.cs +++ b/RoadTrain/RoadTrain/MoveToBorder.cs @@ -19,7 +19,6 @@ namespace RoadTrain.MovementStrategy objParams.RightBorder + GetStep() >= FieldWidth && objParams.DownBorder <= FieldHeight && objParams.DownBorder + GetStep() >= FieldHeight; - } protected override void MoveToTarget() { diff --git a/RoadTrain/RoadTrain/RoadTrain.cs b/RoadTrain/RoadTrain/RoadTrain.cs index 56b2b1a..22fa028 100644 --- a/RoadTrain/RoadTrain/RoadTrain.cs +++ b/RoadTrain/RoadTrain/RoadTrain.cs @@ -114,4 +114,4 @@ namespace RoadTrain } } } -} +} \ No newline at end of file