From c8cd888bf16e0caf7ee4492a2222c7039c14ca27 Mon Sep 17 00:00:00 2001 From: malimova Date: Sat, 7 Oct 2023 10:59:50 +0400 Subject: [PATCH] =?UTF-8?q?=D0=A4=D0=BE=D1=80=D0=BC=D0=B0=D1=82=D0=B8?= =?UTF-8?q?=D1=80=D0=BE=D0=B2=D0=B0=D0=BD=D0=B8=D0=B5=20=D0=BA=D0=BE=D0=B4?= =?UTF-8?q?=D0=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- AirBomber/AirBomber/DrawningAirBomber.cs | 22 ++++++++++------------ AirBomber/AirBomber/DrawningAirPlane.cs | 4 ++++ AirBomber/AirBomber/EntityAirPlane.cs | 1 - AirBomber/AirBomber/MoveToBorder.cs | 1 - AirBomber/AirBomber/Program.cs | 1 - 5 files changed, 14 insertions(+), 15 deletions(-) diff --git a/AirBomber/AirBomber/DrawningAirBomber.cs b/AirBomber/AirBomber/DrawningAirBomber.cs index ef48919..5ed19eb 100644 --- a/AirBomber/AirBomber/DrawningAirBomber.cs +++ b/AirBomber/AirBomber/DrawningAirBomber.cs @@ -23,7 +23,6 @@ namespace AirBomber /// Высота картинки public DrawningAirBomber(int speed, double weight, Color bodyColor, Color additionalColor, bool bombs, Color bombsColor, bool fuelTanks, int width, int height) : - base(speed, weight, bodyColor, width, height, 160, 118) { if (EntityAirPlane != null) @@ -42,18 +41,17 @@ namespace AirBomber Brush bombsColor = new SolidBrush(airBomber.BombsColor); base.DrawPlane(g); // обвесы - g.FillEllipse(bombsColor, _startPosX + 90, _startPosY + 20, 15, 29); - g.DrawEllipse(pen, _startPosX + 90, _startPosY + 20, 15, 29); - g.FillEllipse(bombsColor, _startPosX + 90, _startPosY + 70, 15, 29); - g.DrawEllipse(pen, _startPosX + 90, _startPosY + 70, 15, 29); - g.FillEllipse(bombsColor, _startPosX + 140, _startPosY + 50, 15, 15); - g.DrawEllipse(pen, _startPosX + 140, _startPosY + 50, 15, 15); + g.FillEllipse(bombsColor, _startPosX + 90, _startPosY + 20, 15, 29); + g.DrawEllipse(pen, _startPosX + 90, _startPosY + 20, 15, 29); + g.FillEllipse(bombsColor, _startPosX + 90, _startPosY + 70, 15, 29); + g.DrawEllipse(pen, _startPosX + 90, _startPosY + 70, 15, 29); + g.FillEllipse(bombsColor, _startPosX + 140, _startPosY + 50, 15, 15); + g.DrawEllipse(pen, _startPosX + 140, _startPosY + 50, 15, 15); // fueltanks - g.FillRectangle(additionalBrush, _startPosX + 63, _startPosY + 34, 20, 15); - g.DrawRectangle(pen, _startPosX + 63, _startPosY + 34, 20, 15); - g.FillRectangle(additionalBrush, _startPosX + 63, _startPosY + 70, 20, 15); - g.DrawRectangle(pen, _startPosX + 63, _startPosY + 70, 20, 15); - + g.FillRectangle(additionalBrush, _startPosX + 63, _startPosY + 34, 20, 15); + g.DrawRectangle(pen, _startPosX + 63, _startPosY + 34, 20, 15); + g.FillRectangle(additionalBrush, _startPosX + 63, _startPosY + 70, 20, 15); + g.DrawRectangle(pen, _startPosX + 63, _startPosY + 70, 20, 15); } } } diff --git a/AirBomber/AirBomber/DrawningAirPlane.cs b/AirBomber/AirBomber/DrawningAirPlane.cs index 31a4a17..758f92c 100644 --- a/AirBomber/AirBomber/DrawningAirPlane.cs +++ b/AirBomber/AirBomber/DrawningAirPlane.cs @@ -49,6 +49,10 @@ namespace AirBomber width, int height) { // TODO: Продумать проверки + if (width < _airPlaneWidth || height < _airPlaneHeight) + { + return; + } _pictureWidth = width; _pictureHeight = height; EntityAirPlane = new EntityAirPlane(speed, weight, bodyColor); diff --git a/AirBomber/AirBomber/EntityAirPlane.cs b/AirBomber/AirBomber/EntityAirPlane.cs index 8934f22..a8341c9 100644 --- a/AirBomber/AirBomber/EntityAirPlane.cs +++ b/AirBomber/AirBomber/EntityAirPlane.cs @@ -37,6 +37,5 @@ namespace AirBomber Weight = weight; BodyColor = bodyColor; } - } } diff --git a/AirBomber/AirBomber/MoveToBorder.cs b/AirBomber/AirBomber/MoveToBorder.cs index f0c5ff3..b853ffd 100644 --- a/AirBomber/AirBomber/MoveToBorder.cs +++ b/AirBomber/AirBomber/MoveToBorder.cs @@ -15,7 +15,6 @@ namespace AirBomber return objParams.RightBorder >= FieldWidth - GetStep() && objParams.DownBorder >= FieldHeight - GetStep(); } - protected override void MoveToTarget() { var objParams = GetObjectParameters; diff --git a/AirBomber/AirBomber/Program.cs b/AirBomber/AirBomber/Program.cs index f167f45..76b85fe 100644 --- a/AirBomber/AirBomber/Program.cs +++ b/AirBomber/AirBomber/Program.cs @@ -7,7 +7,6 @@ namespace AirBomber /// [STAThread] static void Main() - { // To customize application configuration such as set high DPI settings or default font, // see https://aka.ms/applicationconfiguration.