From e982b77a38ed4c62b7fce6cbec3007766834843c Mon Sep 17 00:00:00 2001 From: SAliulov <146759803+SAliulov@users.noreply.github.com> Date: Sat, 20 Apr 2024 21:45:37 +0300 Subject: [PATCH] =?UTF-8?q?=D0=A2=D0=B5=D1=81=D1=8203?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../ProjectAirBomber/Drawnings/DrawningAirBomber.cs | 10 ++-------- ProjectAirBomber/ProjectAirBomber/FormAirBomber.cs | 1 - .../ProjectAirBomber/MovementStrategy/MoveToBorder.cs | 2 +- .../MovementStrategy/MoveableBomber.cs | 4 +--- 4 files changed, 4 insertions(+), 13 deletions(-) diff --git a/ProjectAirBomber/ProjectAirBomber/Drawnings/DrawningAirBomber.cs b/ProjectAirBomber/ProjectAirBomber/Drawnings/DrawningAirBomber.cs index 578a8c5..4295c92 100644 --- a/ProjectAirBomber/ProjectAirBomber/Drawnings/DrawningAirBomber.cs +++ b/ProjectAirBomber/ProjectAirBomber/Drawnings/DrawningAirBomber.cs @@ -5,6 +5,7 @@ namespace ProjectAirBomber.Drawnings; /// /// Класс, отвечающий за прорисовку и перемещение объекта-сущности /// +/// public class DrawningAirBomber : DrawningBomber { @@ -19,16 +20,12 @@ public class DrawningAirBomber : DrawningBomber /// Признак наличия бомб - - - //TO DO! + //TO DO!!! public DrawningAirBomber(int speed, double weight, Color bodyColor, Color additionalColor, bool fuelTanks, bool bombs) : base(200, 160) { EntityBomber = new EntityAirBomber(speed, weight, bodyColor, additionalColor, fuelTanks, bombs); } - - public override void DrawTransport(Graphics g) { if (EntityBomber == null || EntityBomber is not EntityAirBomber airBomber || !_startPosX.HasValue || !_startPosY.HasValue) @@ -63,13 +60,10 @@ public class DrawningAirBomber : DrawningBomber new Point(_startPosX.Value + 80, _startPosY.Value + 100) }); } - _startPosX += 10; _startPosY += 5; base.DrawTransport(g); _startPosX -= 10; _startPosY -= 5; - - } } \ No newline at end of file diff --git a/ProjectAirBomber/ProjectAirBomber/FormAirBomber.cs b/ProjectAirBomber/ProjectAirBomber/FormAirBomber.cs index 794387c..8c94774 100644 --- a/ProjectAirBomber/ProjectAirBomber/FormAirBomber.cs +++ b/ProjectAirBomber/ProjectAirBomber/FormAirBomber.cs @@ -17,7 +17,6 @@ public partial class FormAirBomber : Form /// private AbstractStrategy? _strategy; - /// /// Получение объекта /// diff --git a/ProjectAirBomber/ProjectAirBomber/MovementStrategy/MoveToBorder.cs b/ProjectAirBomber/ProjectAirBomber/MovementStrategy/MoveToBorder.cs index bc10052..2486041 100644 --- a/ProjectAirBomber/ProjectAirBomber/MovementStrategy/MoveToBorder.cs +++ b/ProjectAirBomber/ProjectAirBomber/MovementStrategy/MoveToBorder.cs @@ -1,5 +1,4 @@ using ProjectAirBomber.MovementStrategy; - namespace ProjectAirBomber.MovementStrategy; /// @@ -20,6 +19,7 @@ public class MoveToBorder : AbstractStrategy && objParams.ObjectMiddleVertical + GetStep() >= FieldHeight; } + protected override void MoveToTarget() { ObjectParameters? objParams = GetObjectParameters; diff --git a/ProjectAirBomber/ProjectAirBomber/MovementStrategy/MoveableBomber.cs b/ProjectAirBomber/ProjectAirBomber/MovementStrategy/MoveableBomber.cs index dd96191..3d3eb0f 100644 --- a/ProjectAirBomber/ProjectAirBomber/MovementStrategy/MoveableBomber.cs +++ b/ProjectAirBomber/ProjectAirBomber/MovementStrategy/MoveableBomber.cs @@ -1,7 +1,7 @@ using ProjectAirBomber.Drawnings; - namespace ProjectAirBomber.MovementStrategy; + public class MoveableBomber : IMoveableObject { /// @@ -55,6 +55,4 @@ public class MoveableBomber : IMoveableObject _ => DirectionType.Unknow, }; } - - }