From 62e9cfef11b77888b43a040c01ce7cfba97182e3 Mon Sep 17 00:00:00 2001 From: "nikbel2004@outlook.com" Date: Sun, 8 Oct 2023 00:30:07 +0400 Subject: [PATCH] =?UTF-8?q?=D0=9F=D1=80=D0=B0=D0=B2=D0=BA=D0=B8=20=D0=BB?= =?UTF-8?q?=D0=B0=D0=B1=D0=BE=D1=80=D0=B0=D1=82=D0=BE=D1=80=D0=BD=D0=B0?= =?UTF-8?q?=D1=8F=202?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Tank/Tank/DrawArmoVehicle.cs | 13 ++----------- Tank/Tank/DrawTank.cs | 12 ++++++------ 2 files changed, 8 insertions(+), 17 deletions(-) diff --git a/Tank/Tank/DrawArmoVehicle.cs b/Tank/Tank/DrawArmoVehicle.cs index be5947b..aa389df 100644 --- a/Tank/Tank/DrawArmoVehicle.cs +++ b/Tank/Tank/DrawArmoVehicle.cs @@ -112,18 +112,9 @@ namespace Tank Brush BrushRandom = new SolidBrush(Tank?.BodyColor ?? Color.Black); //Корпус - Brush WhiteColor = new SolidBrush(Color.White); - g.FillRectangle(WhiteColor, _startPosX, _startPosY, 155, 30); - - Point[] pointsbody1 = { new Point(_startPosX + 5, _startPosY + 30), new Point(_startPosX + 110, _startPosY + 30), + Point[] pointsbody = { new Point(_startPosX + 5, _startPosY + 30), new Point(_startPosX + 110, _startPosY + 30), new Point(_startPosX + 142, _startPosY + 30), new Point(_startPosX + 120, _startPosY + 45), new Point(_startPosX + 12, _startPosY + 45) }; - g.FillPolygon(BrushRandom, pointsbody1); - - // Гусеница - g.FillRectangle(BrushRandom, 28 + _startPosX, 50 + _startPosY, 10, 3); - g.FillRectangle(BrushRandom, 53 + _startPosX, 50 + _startPosY, 10, 3); - g.FillRectangle(BrushRandom, 78 + _startPosX, 50 + _startPosY, 10, 3); - g.FillRectangle(BrushRandom, 103 + _startPosX, 50 + _startPosY, 10, 3); + g.FillPolygon(BrushRandom, pointsbody); // Колеса, катки Brush ColorBlack = new SolidBrush(Color.Black); diff --git a/Tank/Tank/DrawTank.cs b/Tank/Tank/DrawTank.cs index 8e94d83..2406af3 100644 --- a/Tank/Tank/DrawTank.cs +++ b/Tank/Tank/DrawTank.cs @@ -37,19 +37,19 @@ namespace Tank.DrawningObjects if (ArmoVehicle.Caterpillar) { - Pen pen = new(Color.Black); - Brush lineBrush = new SolidBrush(Color.Gray); // Гусеница // Отрисовка танковых катков - Brush BrushBlack = new SolidBrush(Color.Black); - g.FillEllipse(BrushBlack, _startPosX + 113, _startPosY + 41, 11, 11); - g.FillEllipse(BrushBlack, _startPosX + 13, _startPosY + 40, 11, 11); + Brush BrushRandom = new SolidBrush(Tank?.BodyColor ?? Color.Black); + g.FillRectangle(BrushRandom, 28 + _startPosX, 50 + _startPosY, 10, 3); + g.FillRectangle(BrushRandom, 53 + _startPosX, 50 + _startPosY, 10, 3); + g.FillRectangle(BrushRandom, 78 + _startPosX, 50 + _startPosY, 10, 3); + g.FillRectangle(BrushRandom, 103 + _startPosX, 50 + _startPosY, 10, 3); } if (ArmoVehicle.Tower) { - Brush bodyBrush = new SolidBrush(ArmoVehicle.AdditionalColor); // Орудие + Brush bodyBrush = new SolidBrush(ArmoVehicle.AdditionalColor); g.FillRectangle(bodyBrush, _startPosX + 111, _startPosY + 17, 70, 5); // Зенитное орудие