Тест03

This commit is contained in:
SAliulov 2024-04-20 21:45:37 +03:00
parent f2bfec6818
commit e982b77a38
4 changed files with 4 additions and 13 deletions

View File

@ -5,6 +5,7 @@ namespace ProjectAirBomber.Drawnings;
/// <summary> /// <summary>
/// Класс, отвечающий за прорисовку и перемещение объекта-сущности /// Класс, отвечающий за прорисовку и перемещение объекта-сущности
/// </summary> /// </summary>
///
public class DrawningAirBomber : DrawningBomber public class DrawningAirBomber : DrawningBomber
{ {
@ -19,16 +20,12 @@ public class DrawningAirBomber : DrawningBomber
/// <param name="bombs">Признак наличия бомб</param> /// <param name="bombs">Признак наличия бомб</param>
//TO DO!!!
//TO DO!
public DrawningAirBomber(int speed, double weight, Color bodyColor, Color additionalColor, bool fuelTanks, bool bombs) : base(200, 160) 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); EntityBomber = new EntityAirBomber(speed, weight, bodyColor, additionalColor, fuelTanks, bombs);
} }
public override void DrawTransport(Graphics g) public override void DrawTransport(Graphics g)
{ {
if (EntityBomber == null || EntityBomber is not EntityAirBomber airBomber || !_startPosX.HasValue || !_startPosY.HasValue) 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) new Point(_startPosX.Value + 80, _startPosY.Value + 100)
}); });
} }
_startPosX += 10; _startPosX += 10;
_startPosY += 5; _startPosY += 5;
base.DrawTransport(g); base.DrawTransport(g);
_startPosX -= 10; _startPosX -= 10;
_startPosY -= 5; _startPosY -= 5;
} }
} }

View File

@ -17,7 +17,6 @@ public partial class FormAirBomber : Form
/// </summary> /// </summary>
private AbstractStrategy? _strategy; private AbstractStrategy? _strategy;
/// <summary> /// <summary>
/// Получение объекта /// Получение объекта
/// </summary> /// </summary>

View File

@ -1,5 +1,4 @@
using ProjectAirBomber.MovementStrategy; using ProjectAirBomber.MovementStrategy;
namespace ProjectAirBomber.MovementStrategy; namespace ProjectAirBomber.MovementStrategy;
/// <summary> /// <summary>
@ -20,6 +19,7 @@ public class MoveToBorder : AbstractStrategy
&& objParams.ObjectMiddleVertical + GetStep() >= FieldHeight; && objParams.ObjectMiddleVertical + GetStep() >= FieldHeight;
} }
protected override void MoveToTarget() protected override void MoveToTarget()
{ {
ObjectParameters? objParams = GetObjectParameters; ObjectParameters? objParams = GetObjectParameters;

View File

@ -1,7 +1,7 @@
using ProjectAirBomber.Drawnings; using ProjectAirBomber.Drawnings;
namespace ProjectAirBomber.MovementStrategy; namespace ProjectAirBomber.MovementStrategy;
public class MoveableBomber : IMoveableObject public class MoveableBomber : IMoveableObject
{ {
/// <summary> /// <summary>
@ -55,6 +55,4 @@ public class MoveableBomber : IMoveableObject
_ => DirectionType.Unknow, _ => DirectionType.Unknow,
}; };
} }
} }