From 37f598f718d55a4c4f2be435f5eceb28218d16e9 Mon Sep 17 00:00:00 2001 From: Oleg Date: Mon, 26 Sep 2022 22:23:12 +0400 Subject: [PATCH] =?UTF-8?q?=D0=A0=D0=BE=D0=B3=D0=B0=20=D0=B8=20=D0=B1?= =?UTF-8?q?=D0=B0=D1=82=D0=B0=D1=80=D0=B5=D1=8F=20=D0=BD=D0=B0=20=D1=82?= =?UTF-8?q?=D1=80=D0=BE=D0=BB=D0=BB=D0=B5=D0=B9=D0=B1=D1=83=D1=81=D0=B5=20?= =?UTF-8?q?=D0=B2=20=D0=B2=D0=B8=D0=B4=D0=B5=20=D0=BC=D0=BE=D0=B4=D0=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Trolleybus/DrawingSmallTrolleybus.cs | 68 +++++++++---------- .../Trolleybus/EntitySmallTrolleybus.cs | 8 +-- Trolleybus/Trolleybus/Program.cs | 2 +- 3 files changed, 38 insertions(+), 40 deletions(-) diff --git a/Trolleybus/Trolleybus/DrawingSmallTrolleybus.cs b/Trolleybus/Trolleybus/DrawingSmallTrolleybus.cs index 0033ac2..d49a881 100644 --- a/Trolleybus/Trolleybus/DrawingSmallTrolleybus.cs +++ b/Trolleybus/Trolleybus/DrawingSmallTrolleybus.cs @@ -24,38 +24,35 @@ namespace Trolleybus Pen pen = new Pen(Color.Black); Brush dopBrush = new SolidBrush(smallTrolleybus.DopColor); + Brush brBlue = new SolidBrush(Color.LightBlue); + Brush dBlue = new SolidBrush(Color.DarkBlue); + Brush bWhite = new SolidBrush(Color.White); + Pen WinBlue = new Pen(Color.Blue); + + _startPosY = _startPosY + 100; if (smallTrolleybus.BodyKit) { - g.DrawEllipse(pen, _startPosX + 90, _startPosY, 20, 20); - g.DrawEllipse(pen, _startPosX + 90, _startPosY + 40, 20, 20); - g.DrawRectangle(pen, _startPosX + 90, _startPosY + 10, 20, 40); - g.DrawRectangle(pen, _startPosX + 90, _startPosY, 15, 15); - g.DrawRectangle(pen, _startPosX + 90, _startPosY + 45, 15, 15); - - g.FillEllipse(dopBrush, _startPosX + 90, _startPosY, 20, 20); - g.FillEllipse(dopBrush, _startPosX + 90, _startPosY + 40, 20, 20); - g.FillRectangle(dopBrush, _startPosX + 90, _startPosY + 10, 20, 40); - g.FillRectangle(dopBrush, _startPosX + 90, _startPosY + 1, 15, 15); - g.FillRectangle(dopBrush, _startPosX + 90, _startPosY + 45, 15, 15); - - g.DrawEllipse(pen, _startPosX, _startPosY, 20, 20); - g.DrawEllipse(pen, _startPosX, _startPosY + 40, 20, 20); - g.DrawRectangle(pen, _startPosX, _startPosY + 10, 20, 40); - g.DrawRectangle(pen, _startPosX + 5, _startPosY, 14, 15); - g.DrawRectangle(pen, _startPosX + 5, _startPosY + 45, 14, 15); - - g.FillEllipse(dopBrush, _startPosX, _startPosY, 20, 20); - g.FillEllipse(dopBrush, _startPosX, _startPosY + 40, 20, 20); - g.FillRectangle(dopBrush, _startPosX + 1, _startPosY + 10, 25, 40); - g.FillRectangle(dopBrush, _startPosX + 5, _startPosY + 1, 15, 15); - g.FillRectangle(dopBrush, _startPosX + 5, _startPosY + 45, 15, 15); - - g.DrawRectangle(pen, _startPosX + 35, _startPosY, 39, 15); - g.DrawRectangle(pen, _startPosX + 35, _startPosY + 45, 39, 15); - - g.FillRectangle(dopBrush, _startPosX + 35, _startPosY + 1, 40, 15); - g.FillRectangle(dopBrush, _startPosX + 35, _startPosY + 45, 40, 15); + g.DrawRectangle(pen, _startPosX, _startPosY, 200, 50); + g.DrawRectangle(pen, _startPosX + 100, _startPosY + 10, 20, 40); + g.FillEllipse(brBlue, _startPosX, _startPosY + 5, 20, 25); + g.DrawEllipse(WinBlue, _startPosX, _startPosY + 5, 20, 25); + g.FillEllipse(brBlue, _startPosX + 25, _startPosY + 5, 20, 25); + g.DrawEllipse(WinBlue, _startPosX + 25, _startPosY + 5, 20, 25); + g.FillEllipse(brBlue, _startPosX + 50, _startPosY + 5, 20, 25); + g.DrawEllipse(WinBlue, _startPosX + 50, _startPosY + 5, 20, 25); + g.FillEllipse(brBlue, _startPosX + 75, _startPosY + 5, 20, 25); + g.DrawEllipse(WinBlue, _startPosX + 75, _startPosY + 5, 20, 25); + g.FillEllipse(brBlue, _startPosX + 120, _startPosY + 5, 20, 25); + g.DrawEllipse(WinBlue, _startPosX + 120, _startPosY + 5, 20, 25); + g.FillEllipse(brBlue, _startPosX + 145, _startPosY + 5, 20, 25); + g.DrawEllipse(WinBlue, _startPosX + 145, _startPosY + 5, 20, 25); + g.FillEllipse(brBlue, _startPosX + 170, _startPosY + 5, 20, 25); + g.DrawEllipse(WinBlue, _startPosX + 170, _startPosY + 5, 20, 25); + g.FillEllipse(bWhite, _startPosX, _startPosY + 40, 30, 30); + g.DrawEllipse(pen, _startPosX, _startPosY + 40, 30, 30); + g.FillEllipse(bWhite, _startPosX + 170, _startPosY + 40, 30, 30); + g.DrawEllipse(pen, _startPosX + 170, _startPosY + 40, 30, 30); } _startPosX += 10; @@ -64,17 +61,18 @@ namespace Trolleybus _startPosX -= 10; _startPosY -= 5; - if (smallTrolleybus.SportLine) + if (smallTrolleybus.Horns) { - g.FillRectangle(dopBrush, _startPosX + 76, _startPosY + 23, 24, 15); - g.FillRectangle(dopBrush, _startPosX + 36, _startPosY + 23, 34, 15); - g.FillRectangle(dopBrush, _startPosX + 11, _startPosY + 23, 14, 15); + g.DrawLine(pen, _startPosX + 100, _startPosY - 10, _startPosX + 150, _startPosY - 20); + g.DrawLine(pen, _startPosX + 150, _startPosY - 20, _startPosX, _startPosY - 30); + //g.DrawRectangle(pen, _startPosX + 50, _startPosY - 40, 100, 20); + g.DrawRectangle(pen, _startPosX + 50, _startPosY - 10, 100, 10); } if (smallTrolleybus.Wing) { - g.FillRectangle(dopBrush, _startPosX, _startPosY + 5, 10, 50); - g.DrawRectangle(pen, _startPosX, _startPosY + 5, 10, 50); + //g.FillRectangle(dopBrush, _startPosX, _startPosY + 5, 10, 50); + //g.DrawRectangle(pen, _startPosX, _startPosY + 5, 10, 50); } } } diff --git a/Trolleybus/Trolleybus/EntitySmallTrolleybus.cs b/Trolleybus/Trolleybus/EntitySmallTrolleybus.cs index f65843c..f7383dc 100644 --- a/Trolleybus/Trolleybus/EntitySmallTrolleybus.cs +++ b/Trolleybus/Trolleybus/EntitySmallTrolleybus.cs @@ -24,7 +24,7 @@ namespace Trolleybus /// /// Признак наличия гоночной полосы /// - public bool SportLine { get; private set; } + public bool Horns { get; private set; } /// /// Инициализация свойств /// @@ -34,14 +34,14 @@ namespace Trolleybus /// Дополнительный цвет /// Признак наличия обвеса /// Признак наличия антикрыла - /// Признак наличия гоночной полосы - public EntitySmallTrolleybus(int speed, float weight, Color bodyColor, Color dopColor, bool bodyKit, bool wing, bool sportLine) : + /// Признак наличия гоночной полосы + public EntitySmallTrolleybus(int speed, float weight, Color bodyColor, Color dopColor, bool bodyKit, bool wing, bool horns) : base(speed, weight, bodyColor) { DopColor = dopColor; BodyKit = bodyKit; Wing = wing; - SportLine = sportLine; + Horns = horns; } } } diff --git a/Trolleybus/Trolleybus/Program.cs b/Trolleybus/Trolleybus/Program.cs index be48583..3a773ae 100644 --- a/Trolleybus/Trolleybus/Program.cs +++ b/Trolleybus/Trolleybus/Program.cs @@ -16,7 +16,7 @@ namespace Trolleybus { Application.EnableVisualStyles(); Application.SetCompatibleTextRenderingDefault(false); - Application.Run(new FormMap()); + Application.Run(new Form1()); } } }