From 45bf8f801ac4c08123e97a7e3213aef048fcdccf Mon Sep 17 00:00:00 2001 From: Danila_Mochalov Date: Tue, 27 Sep 2022 15:56:36 +0400 Subject: [PATCH] =?UTF-8?q?=D0=93=D0=BE=D1=82=D0=BE=D0=B2=D0=B0=D1=8F=20?= =?UTF-8?q?=D0=BB=D0=B0=D0=B1=202?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Locomotive/Locomotive/AbstractMap.cs | 3 --- Locomotive/Locomotive/DrawningLocomotive.cs | 10 +++++----- Locomotive/Locomotive/RailroadMap.cs | 2 +- Locomotive/Locomotive/SpikeMap.cs | 2 +- 4 files changed, 7 insertions(+), 10 deletions(-) diff --git a/Locomotive/Locomotive/AbstractMap.cs b/Locomotive/Locomotive/AbstractMap.cs index f7aa68c..d83050c 100644 --- a/Locomotive/Locomotive/AbstractMap.cs +++ b/Locomotive/Locomotive/AbstractMap.cs @@ -33,7 +33,6 @@ namespace Locomotive public Bitmap MoveObject(Direction direction) { - // added logic must be checked! bool isFree = true; int startPosX = (int)(_drawningObject.GetCurrentPosition().Left / _size_x); @@ -117,8 +116,6 @@ namespace Locomotive int y = _random.Next(0, 10); _drawningObject.SetObject(x, y, _width, _height); - // added logic must be checked! - for (int i = 0; i < _map.GetLength(0); ++i) { for (int j = 0; j < _map.GetLength(1); ++j) diff --git a/Locomotive/Locomotive/DrawningLocomotive.cs b/Locomotive/Locomotive/DrawningLocomotive.cs index 35c7c93..ee0f470 100644 --- a/Locomotive/Locomotive/DrawningLocomotive.cs +++ b/Locomotive/Locomotive/DrawningLocomotive.cs @@ -107,7 +107,7 @@ namespace Locomotive } Pen pen = new(Color.Black); //тело - g.DrawRectangle(pen, _startPosX , _startPosY, 110 - 10, 50 - 10); + g.FillRectangle(new SolidBrush(Color.MediumBlue), _startPosX , _startPosY, 110 - 10, 50 - 10); //окна g.FillRectangle(new SolidBrush(Locomotive?.BodyColor ?? Color.Black), _startPosX + 10, _startPosY + 10, 10, 10); g.FillRectangle(new SolidBrush(Locomotive?.BodyColor ?? Color.Black), _startPosX + 30, _startPosY + 10, 10, 10); @@ -115,10 +115,10 @@ namespace Locomotive //дверь g.DrawRectangle(pen, _startPosX + 50, _startPosY + 10, 10, 20); //колеса - g.DrawEllipse(pen, _startPosX, _startPosY + 40, 10, 10); - g.DrawEllipse(pen, _startPosX + 20, _startPosY + 40, 10, 10); - g.DrawEllipse(pen, _startPosX + 70, _startPosY + 40, 10, 10); - g.DrawEllipse(pen, _startPosX + 90, _startPosY + 40, 10, 10); + g.FillEllipse(new SolidBrush(Color.Black), _startPosX, _startPosY + 40, 10, 10); + g.FillEllipse(new SolidBrush(Color.Black), _startPosX + 20, _startPosY + 40, 10, 10); + g.FillEllipse(new SolidBrush(Color.Black), _startPosX + 70, _startPosY + 40, 10, 10); + g.FillEllipse(new SolidBrush(Color.Black), _startPosX + 90, _startPosY + 40, 10, 10); //черный прямоугольник g.FillRectangle(new SolidBrush(Locomotive?.BodyColor ?? Color.Black), _startPosX + 100, _startPosY + 10, 10, 30); } diff --git a/Locomotive/Locomotive/RailroadMap.cs b/Locomotive/Locomotive/RailroadMap.cs index f532e07..ac2a5eb 100644 --- a/Locomotive/Locomotive/RailroadMap.cs +++ b/Locomotive/Locomotive/RailroadMap.cs @@ -11,7 +11,7 @@ namespace Locomotive /// Цвет участка закрытого private readonly Brush barrierColor = new SolidBrush(Color.Black); /// Цвет участка открытого - private readonly Brush roadColor = new SolidBrush(Color.Gray); + private readonly Brush roadColor = new SolidBrush(Color.Pink); protected override void DrawBarrierPart(Graphics g, int i, int j) { diff --git a/Locomotive/Locomotive/SpikeMap.cs b/Locomotive/Locomotive/SpikeMap.cs index 8f03023..9dcb666 100644 --- a/Locomotive/Locomotive/SpikeMap.cs +++ b/Locomotive/Locomotive/SpikeMap.cs @@ -11,7 +11,7 @@ namespace Locomotive /// Цвет участка закрытого private readonly Brush barrierColor = new SolidBrush(Color.Black); /// Цвет участка открытого - private readonly Brush roadColor = new SolidBrush(Color.Gray); + private readonly Brush roadColor = new SolidBrush(Color.Green); protected override void DrawBarrierPart(Graphics g, int i, int j) {