Compare commits

..

3 Commits

29 changed files with 1639 additions and 67 deletions

View File

@ -3,7 +3,7 @@ Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 17
VisualStudioVersion = 17.12.35527.113 d17.12
MinimumVisualStudioVersion = 10.0.40219.1
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ProjectA", "ProjectA\ProjectA.csproj", "{1B38AB8E-8721-4385-992F-F63A960D58A4}"
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "AirBus", "AirBus\AirBus.csproj", "{56F7567B-5AB2-4640-BBA7-7A3322BA2BCE}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
@ -11,10 +11,10 @@ Global
Release|Any CPU = Release|Any CPU
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{1B38AB8E-8721-4385-992F-F63A960D58A4}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{1B38AB8E-8721-4385-992F-F63A960D58A4}.Debug|Any CPU.Build.0 = Debug|Any CPU
{1B38AB8E-8721-4385-992F-F63A960D58A4}.Release|Any CPU.ActiveCfg = Release|Any CPU
{1B38AB8E-8721-4385-992F-F63A960D58A4}.Release|Any CPU.Build.0 = Release|Any CPU
{56F7567B-5AB2-4640-BBA7-7A3322BA2BCE}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{56F7567B-5AB2-4640-BBA7-7A3322BA2BCE}.Debug|Any CPU.Build.0 = Debug|Any CPU
{56F7567B-5AB2-4640-BBA7-7A3322BA2BCE}.Release|Any CPU.ActiveCfg = Release|Any CPU
{56F7567B-5AB2-4640-BBA7-7A3322BA2BCE}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE

View File

@ -0,0 +1,26 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>WinExe</OutputType>
<TargetFramework>net8.0-windows</TargetFramework>
<Nullable>enable</Nullable>
<UseWindowsForms>true</UseWindowsForms>
<ImplicitUsings>enable</ImplicitUsings>
</PropertyGroup>
<ItemGroup>
<Compile Update="Properties\Resources.Designer.cs">
<DesignTime>True</DesignTime>
<AutoGen>True</AutoGen>
<DependentUpon>Resources.resx</DependentUpon>
</Compile>
</ItemGroup>
<ItemGroup>
<EmbeddedResource Update="Properties\Resources.resx">
<Generator>ResXFileCodeGenerator</Generator>
<LastGenOutput>Resources.Designer.cs</LastGenOutput>
</EmbeddedResource>
</ItemGroup>
</Project>

View File

@ -0,0 +1,39 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace AirBus.Drawings
{
/// <summary>
/// Направление перемещения
/// </summary>
public enum DirectionType
{
/// <summary>
/// Неизвестное направление
/// </summary>
Unknow = -1,
/// <summary>
/// Вверх
/// </summary>
Up = 1,
/// <summary>
/// Вниз
/// </summary>
Down = 2,
/// <summary>
/// Влево
/// </summary>
Left = 3,
/// <summary>
/// Вправо
/// </summary>
Right = 4,
}
}

View File

@ -0,0 +1,63 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using AirBus.Entities;
namespace AirBus.Drawings
{
/// <summary>
/// Класс отвечающий за прорисовку и перемещение объекта-сущности
/// </summary>
public class DrawingAirBus : DrawingPlane
{
/// <summary>
/// Конструктор
/// </summary>
/// <param name="speed">Скорость</param>
/// <param name="weight">Вес</param>
/// <param name="bodyColor">Основной цвет</param>
/// <param name="additionalColor">Дополнительный цвет</param>
/// <param name="extraEngine">Признак наличия дополнительных пары двигателей</param>
/// <param name="secondFloor">Признак наличия второго этажа</param>
public DrawingAirBus(int speed, double weight, Color bodyColor, Color additionalColor,
bool extraEngine, bool secondFloor) : base(175, 72)
{
EntityPlane = new EntityAirBus(speed, weight, bodyColor, additionalColor, extraEngine, secondFloor);
}
public override void DrawTransport(Graphics g)
{
if (EntityPlane == null || EntityPlane is not EntityAirBus airBus || !_startPosX.HasValue || !_startPosY.HasValue)
{
return;
}
Pen pen = new(Color.Black, 1);
Brush additionalBrush = new SolidBrush(airBus.AdditionalColor);
base.DrawTransport(g);
if (airBus.ExtraEngine) // двигатели опционально
{
g.FillEllipse(additionalBrush, _startPosX.Value + 75, _startPosY.Value + 51, 10, 10);
g.FillEllipse(additionalBrush, _startPosX.Value + 80, _startPosY.Value + 51, 10, 10);
g.DrawArc(pen, _startPosX.Value + 75, _startPosY.Value + 51, 10, 10, 90, 180);
g.DrawArc(pen, _startPosX.Value + 80, _startPosY.Value + 51, 10, 10, -90, 180);
g.DrawLine(pen, new Point(_startPosX.Value + 80, _startPosY.Value + 51), new Point(_startPosX.Value + 85, _startPosY.Value + 51));
g.DrawLine(pen, new Point(_startPosX.Value + 80, _startPosY.Value + 61), new Point(_startPosX.Value + 85, _startPosY.Value + 61));
}
if (airBus.SecondFloor) // пассажирский второй этаж
{
g.FillRectangle(additionalBrush, _startPosX.Value + 90, _startPosY.Value + 25, 50, 10);
g.DrawRectangle(pen, _startPosX.Value + 90, _startPosY.Value + 25, 50, 10);
}
}
}
}

View File

@ -0,0 +1,250 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using AirBus.Entities;
namespace AirBus.Drawings
{
public class DrawingPlane
{
/// <summary>
/// Класс-сущность
/// </summary>
public EntityPlane? EntityPlane { get; protected set; }
/// <summary>
/// Ширина окна
/// </summary>
private int? _pictureWidth;
/// <summary>
/// Высота окна
/// </summary>
private int? _pictureHeight;
/// <summary>
/// Левая координата прорисовки самолёта
/// </summary>
protected int? _startPosX;
/// <summary>
/// Верхняя координата прорисовки самолёта
/// </summary>
protected int? _startPosY;
/// <summary>
/// Ширина прорисовки самолёта
/// </summary>
private readonly int _drawingAirBusWidth = 175;
/// <summary>
/// Ширина прорисовки самолёта
/// </summary>
private readonly int _drawingAirBusHeight = 72;
/// <summary>
/// Координата X объекта
/// </summary>
public int? GetPosX => _startPosX;
/// <summary>
/// Координата Y объекта
/// </summary>
public int? GetPosY => _startPosY;
/// <summary>
/// Ширина объекта
/// </summary>
public int GetWidth => _drawingAirBusWidth;
/// <summary>
/// Высота объекта
/// </summary>
public int GetHeight => _drawingAirBusHeight;
/// <summary>
/// Пустой конструктор
/// </summary>
private DrawingPlane()
{
_pictureHeight = null;
_pictureWidth = null;
_startPosX = null;
_startPosY = null;
}
/// <summary>
/// Конструктор для наследников
/// </summary>
/// <param name="drawingAirBusWidth">Ширина прорисовки</param>
/// <param name="drawingAirBusHeight">Высота прорисовки</param>
protected DrawingPlane(int drawingAirBusWidth, int drawingAirBusHeight) : this()
{
_drawingAirBusWidth = drawingAirBusWidth;
_drawingAirBusHeight = drawingAirBusHeight;
}
/// <summary>
/// Конструктор
/// </summary>
/// <param name="speed">Скорость</param>
/// <param name="weight">Вес</param>
/// <param name="bodyColor">Основной цвет</param>
public DrawingPlane(int speed, double weight, Color bodyColor) : this()
{
EntityPlane = new EntityPlane(speed, weight, bodyColor);
}
/// <summary>
/// Установка границ поля
/// </summary>
/// <param name="width">Ширина поля</param>
/// <param name="height">Высота поля</param>
/// <returns>true - границы заданы, false - проверка не пройдена, нельзя разместить объект в этих размерах </returns>
public bool SetPictureSize(int width, int height)
{
if (width < _drawingAirBusWidth || height < _drawingAirBusHeight)
{
return false;
}
_pictureHeight = height;
_pictureWidth = width;
return true;
}
/// <summary>
/// Установка позиции
/// </summary>
/// <param name="x">Координата x</param>
/// <param name="y">Координата y</param>
public void SetPosition(int x, int y)
{
if (!_pictureWidth.HasValue || !_pictureHeight.HasValue)
{
return;
}
if (x > _pictureHeight.Value || y > _pictureWidth.Value || x < 0 || y < 0)
{
_startPosY = 0;
_startPosX = 0;
}
else
{
_startPosX = x;
_startPosY = y;
}
}
/// <summary>
/// Изменение направления перемещения
/// </summary>
/// <param name="direction">Направление</param>
/// <returns>true - перемещение выполнено, false - перемещение невозможно</returns>
public bool MoveTransport(DirectionType direction)
{
if (EntityPlane == null || !_startPosX.HasValue || !_startPosY.HasValue)
{
return false;
}
switch (direction)
{
case DirectionType.Left:
if (_startPosX.Value - EntityPlane.Step > 0)
{
_startPosX -= (int)EntityPlane.Step;
}
return true;
case DirectionType.Up:
if (_startPosY.Value - EntityPlane.Step > 0)
{
_startPosY -= (int)EntityPlane.Step;
}
return true;
case DirectionType.Right:
if (_startPosX.Value + EntityPlane.Step + _drawingAirBusWidth < _pictureWidth.Value)
{
_startPosX += (int)EntityPlane.Step;
}
return true;
case DirectionType.Down:
if (_startPosY + EntityPlane.Step + _drawingAirBusHeight < _pictureHeight.Value)
{
_startPosY += (int)EntityPlane.Step;
}
return true;
default:
return false;
}
}
/// <summary>
/// Прорисовка объекта
/// </summary>
/// <param name="g"></param>
public virtual void DrawTransport(Graphics g)
{
if (EntityPlane == null || !_startPosX.HasValue || !_startPosY.HasValue)
{
return;
}
Pen pen = new(Color.Black, 1);
Brush br = new SolidBrush(EntityPlane.BodyColor);
Brush brBlack = new SolidBrush(Color.Black);
//точки для заднего крыла
Point[] pointsBackWing = new Point[]
{
new Point(_startPosX.Value + 5, _startPosY.Value + 5),
new Point(_startPosX.Value + 35, _startPosY.Value + 35),
new Point(_startPosX.Value + 5, _startPosY.Value + 35)
};
//точки для носа
Point[] pointsNose = new Point[]
{
new Point(_startPosX.Value + 150, _startPosY.Value + 60),
new Point(_startPosX.Value + 175, _startPosY.Value + 47),
new Point(_startPosX.Value + 150, _startPosY.Value + 35)
};
//заливки
g.FillPolygon(br, pointsBackWing); // заднее крыло
g.FillPie(br, _startPosX.Value, _startPosY.Value + 35, 25, 25, 90, 180); // задняя полуокружность
g.FillRectangle(br, _startPosX.Value + 10, _startPosY.Value + 35, 140, 25); // корпус
g.FillPolygon(br, pointsNose); // нос
g.FillEllipse(br, _startPosX.Value + 40, _startPosY.Value + 65, 7, 7); // заднее шасси
g.FillEllipse(br, _startPosX.Value + 30, _startPosY.Value + 65, 7, 7); // заднее шасси
g.FillEllipse(br, _startPosX.Value + 140, _startPosY.Value + 65, 7, 7); // переднее шасси
//контуры
g.DrawPolygon(pen, pointsBackWing); // заднее крыло
g.DrawArc(pen, _startPosX.Value, _startPosY.Value + 35, 25, 25, 90, 180); // задняя полуокружность
g.DrawLine(pen, new Point(_startPosX.Value + 10, _startPosY.Value + 60), new Point(_startPosX.Value + 150, _startPosY.Value + 60)); // нижний контур корпуса
g.DrawLine(pen, new Point(_startPosX.Value + 35, _startPosY.Value + 35), new Point(_startPosX.Value + 150, _startPosY.Value + 35)); // верхний контур корпуса
g.DrawPolygon(pen, pointsNose); // нос
g.DrawLine(pen, new Point(_startPosX.Value + 150, _startPosY.Value + 47), new Point(_startPosX.Value + 175, _startPosY.Value + 47)); // окна на носе
g.DrawEllipse(pen, _startPosX.Value + 40, _startPosY.Value + 65, 7, 7); // заднее шасси
g.DrawEllipse(pen, _startPosX.Value + 30, _startPosY.Value + 65, 7, 7); // заднее шасси
g.DrawEllipse(pen, _startPosX.Value + 140, _startPosY.Value + 65, 7, 7); // переднее шасси
g.DrawLine(pen, new Point(_startPosX.Value + 38, _startPosY.Value + 60), new Point(_startPosX.Value + 38, _startPosY.Value + 70)); // стойка заднего шасси
g.DrawLine(pen, new Point(_startPosX.Value + 39, _startPosY.Value + 60), new Point(_startPosX.Value + 39, _startPosY.Value + 70)); // стойка заднего шасси
g.DrawLine(pen, new Point(_startPosX.Value + 144, _startPosY.Value + 60), new Point(_startPosX.Value + 144, _startPosY.Value + 65)); // стойка переднего шасси
// чёрные заливки
g.FillEllipse(brBlack, _startPosX.Value, _startPosY.Value + 30, 10, 10); // заднее крыло
g.FillEllipse(brBlack, _startPosX.Value + 15, _startPosY.Value + 30, 10, 10);
g.FillRectangle(brBlack, _startPosX.Value + 5, _startPosY.Value + 30, 15, 10);
g.FillEllipse(brBlack, _startPosX.Value + 50, _startPosY.Value + 45, 7, 7); //крыло
g.FillRectangle(brBlack, _startPosX.Value + 54, _startPosY.Value + 45, 55, 7);
g.FillEllipse(brBlack, _startPosX.Value + 105, _startPosY.Value + 45, 7, 7);
}
}
}

View File

@ -0,0 +1,46 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace AirBus.Entities
{
/// <summary>
/// Класс-сущность "Аэробус"
/// </summary>
public class EntityAirBus : EntityPlane
{
/// <summary>
/// Дополнительный цвет для опциональных элементов
/// </summary>
public Color AdditionalColor { get; private set; }
/// <summary>
/// Признак (опция) наличия дополнительной пары двигателей
/// </summary>
public bool ExtraEngine { get; private set; }
/// <summary>
/// Признак (опция) наличия второго этажа
/// </summary>
public bool SecondFloor { get; private set; }
/// <summary>
/// Конструктор объекта-класса самолёта "Аэробус"
/// </summary>
/// <param name="speed">Скорость</param>
/// <param name="weight">Вес</param>
/// <param name="bodyColor">Основной цвет</param>
/// <param name="additionalColor">Дополнительный цвет</param>
/// <param name="extraEngine">Признак наличия дополнительных пары двигателей</param>
/// <param name="secondFloor">Признак наличия второго этажа</param>
public EntityAirBus(int speed, double weight, Color bodyColor, Color additionalColor,
bool extraEngine, bool secondFloor) : base(speed, weight, bodyColor)
{
AdditionalColor = additionalColor;
ExtraEngine = extraEngine;
SecondFloor = secondFloor;
}
}
}

View File

@ -0,0 +1,49 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace AirBus.Entities
{
/// <summary>
/// Класс-сущность "Самолёт"
/// </summary>
public class EntityPlane
{
/// <summary>
/// Скорость
/// </summary>
public int Speed { get; protected set; }
/// <summary>
/// Вес
/// </summary>
public double Weight { get; protected set; }
/// <summary>
/// Цвет корпуса
/// </summary>
public Color BodyColor { get; protected set; }
/// <summary>
/// Шаг перемещения самолёта
/// </summary>
public double Step => Speed * 100 / Weight;
/// <summary>
/// Конструктор сущности Plane
/// </summary>
/// <param name="speed">Скорость</param>
/// <param name="weight">Вес</param>
/// <param name="bodyColor">Основной цвет</param>
public EntityPlane(int speed, double weight, Color bodyColor)
{
Speed = speed;
Weight = weight;
BodyColor = bodyColor;
}
}
}

178
AirBus/AirBus/FormAirBus.Designer.cs generated Normal file
View File

@ -0,0 +1,178 @@
namespace AirBus
{
partial class FormAirBus
{
/// <summary>
/// Required designer variable.
/// </summary>
private System.ComponentModel.IContainer components = null;
/// <summary>
/// Clean up any resources being used.
/// </summary>
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
{
components.Dispose();
}
base.Dispose(disposing);
}
#region Windows Form Designer generated code
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent()
{
System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(FormAirBus));
pictureBoxAirBus = new PictureBox();
buttonCreateAirBus = new Button();
buttonLeft = new Button();
buttonUp = new Button();
buttonDown = new Button();
buttonRight = new Button();
buttonCreatePlane = new Button();
comboBoxStrategy = new ComboBox();
buttonStrategyStep = new Button();
((System.ComponentModel.ISupportInitialize)pictureBoxAirBus).BeginInit();
SuspendLayout();
//
// pictureBoxAirBus
//
pictureBoxAirBus.Dock = DockStyle.Fill;
pictureBoxAirBus.Location = new Point(0, 0);
pictureBoxAirBus.Name = "pictureBoxAirBus";
pictureBoxAirBus.Size = new Size(1004, 468);
pictureBoxAirBus.TabIndex = 0;
pictureBoxAirBus.TabStop = false;
//
// buttonCreateAirBus
//
buttonCreateAirBus.Anchor = AnchorStyles.Bottom | AnchorStyles.Left;
buttonCreateAirBus.Location = new Point(12, 427);
buttonCreateAirBus.Name = "buttonCreateAirBus";
buttonCreateAirBus.Size = new Size(305, 29);
buttonCreateAirBus.TabIndex = 1;
buttonCreateAirBus.Text = "Создать AirBus";
buttonCreateAirBus.UseVisualStyleBackColor = true;
buttonCreateAirBus.Click += buttonCreateAirBus_Click;
//
// buttonLeft
//
buttonLeft.Anchor = AnchorStyles.Bottom | AnchorStyles.Right;
buttonLeft.BackgroundImage = (Image)resources.GetObject("buttonLeft.BackgroundImage");
buttonLeft.BackgroundImageLayout = ImageLayout.Stretch;
buttonLeft.Location = new Point(875, 421);
buttonLeft.Name = "buttonLeft";
buttonLeft.Size = new Size(35, 35);
buttonLeft.TabIndex = 2;
buttonLeft.UseVisualStyleBackColor = true;
buttonLeft.Click += ButtonMove_Click;
//
// buttonUp
//
buttonUp.Anchor = AnchorStyles.Bottom | AnchorStyles.Right;
buttonUp.BackgroundImage = (Image)resources.GetObject("buttonUp.BackgroundImage");
buttonUp.BackgroundImageLayout = ImageLayout.Stretch;
buttonUp.Location = new Point(916, 380);
buttonUp.Name = "buttonUp";
buttonUp.Size = new Size(35, 35);
buttonUp.TabIndex = 2;
buttonUp.TextAlign = ContentAlignment.BottomLeft;
buttonUp.UseVisualStyleBackColor = true;
buttonUp.Click += ButtonMove_Click;
//
// buttonDown
//
buttonDown.Anchor = AnchorStyles.Bottom | AnchorStyles.Right;
buttonDown.BackgroundImage = (Image)resources.GetObject("buttonDown.BackgroundImage");
buttonDown.BackgroundImageLayout = ImageLayout.Stretch;
buttonDown.Location = new Point(916, 421);
buttonDown.Name = "buttonDown";
buttonDown.Size = new Size(35, 35);
buttonDown.TabIndex = 2;
buttonDown.TextAlign = ContentAlignment.BottomLeft;
buttonDown.UseVisualStyleBackColor = true;
buttonDown.Click += ButtonMove_Click;
//
// buttonRight
//
buttonRight.Anchor = AnchorStyles.Bottom | AnchorStyles.Right;
buttonRight.BackgroundImage = (Image)resources.GetObject("buttonRight.BackgroundImage");
buttonRight.BackgroundImageLayout = ImageLayout.Stretch;
buttonRight.Location = new Point(957, 421);
buttonRight.Name = "buttonRight";
buttonRight.Size = new Size(35, 35);
buttonRight.TabIndex = 2;
buttonRight.TextAlign = ContentAlignment.BottomLeft;
buttonRight.UseVisualStyleBackColor = true;
buttonRight.Click += ButtonMove_Click;
//
// buttonCreatePlane
//
buttonCreatePlane.Anchor = AnchorStyles.Bottom | AnchorStyles.Left;
buttonCreatePlane.Location = new Point(333, 427);
buttonCreatePlane.Name = "buttonCreatePlane";
buttonCreatePlane.Size = new Size(305, 29);
buttonCreatePlane.TabIndex = 1;
buttonCreatePlane.Text = "Создать самолёт";
buttonCreatePlane.UseVisualStyleBackColor = true;
buttonCreatePlane.Click += buttonCreateAirBus_Click;
//
// comboBoxStrategy
//
comboBoxStrategy.DropDownStyle = ComboBoxStyle.DropDownList;
comboBoxStrategy.FormattingEnabled = true;
comboBoxStrategy.Items.AddRange(new object[] { "К центру", "К краю" });
comboBoxStrategy.Location = new Point(841, 12);
comboBoxStrategy.Name = "comboBoxStrategy";
comboBoxStrategy.Size = new Size(151, 28);
comboBoxStrategy.TabIndex = 3;
//
// buttonStrategyStep
//
buttonStrategyStep.Location = new Point(898, 46);
buttonStrategyStep.Name = "buttonStrategyStep";
buttonStrategyStep.Size = new Size(94, 29);
buttonStrategyStep.TabIndex = 4;
buttonStrategyStep.Text = "Шаг";
buttonStrategyStep.UseVisualStyleBackColor = true;
buttonStrategyStep.Click += buttonStrategyStep_Click;
//
// FormAirBus
//
AutoScaleDimensions = new SizeF(8F, 20F);
AutoScaleMode = AutoScaleMode.Font;
ClientSize = new Size(1004, 468);
Controls.Add(buttonStrategyStep);
Controls.Add(comboBoxStrategy);
Controls.Add(buttonRight);
Controls.Add(buttonDown);
Controls.Add(buttonUp);
Controls.Add(buttonLeft);
Controls.Add(buttonCreatePlane);
Controls.Add(buttonCreateAirBus);
Controls.Add(pictureBoxAirBus);
Name = "FormAirBus";
Text = "Аэробус";
((System.ComponentModel.ISupportInitialize)pictureBoxAirBus).EndInit();
ResumeLayout(false);
}
#endregion
private PictureBox pictureBoxAirBus;
private Button buttonCreateAirBus;
private Button buttonLeft;
private Button buttonUp;
private Button buttonDown;
private Button buttonRight;
private Button buttonCreatePlane;
private ComboBox comboBoxStrategy;
private Button buttonStrategyStep;
}
}

151
AirBus/AirBus/FormAirBus.cs Normal file
View File

@ -0,0 +1,151 @@
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using AirBus.Drawings;
using AirBus.MovementStrategy;
namespace AirBus;
public partial class FormAirBus : Form
{
private DrawingPlane? _drawingPlane;
private AbstractStrategy? _strategy;
public FormAirBus()
{
InitializeComponent();
_strategy = null;
}
private void Draw()
{
if (_drawingPlane == null)
{
return;
}
Bitmap bmp = new(pictureBoxAirBus.Width, pictureBoxAirBus.Height);
Graphics gr = Graphics.FromImage(bmp);
_drawingPlane.DrawTransport(gr);
pictureBoxAirBus.Image = bmp;
}
private void CreateObject(string type)
{
Random random = new();
switch (type)
{
case nameof(DrawingPlane):
_drawingPlane = new DrawingPlane(random.Next(100, 300), random.Next(1000, 3000),
Color.FromArgb(random.Next(0, 256), random.Next(0, 256), random.Next(0, 256)));
break;
case nameof(DrawingAirBus):
_drawingPlane = new DrawingAirBus(random.Next(100, 300), random.Next(1000, 3000),
Color.FromArgb(random.Next(0, 256), random.Next(0, 256), random.Next(0, 256)),
Color.FromArgb(random.Next(0, 256), random.Next(0, 256), random.Next(0, 256)),
Convert.ToBoolean(random.Next(0, 2)), Convert.ToBoolean(random.Next(0, 2)));
break;
default:
return;
}
_drawingPlane.SetPictureSize(pictureBoxAirBus.Width, pictureBoxAirBus.Height);
_drawingPlane.SetPosition(random.Next(10, 100), random.Next(10, 100));
_strategy = null;
comboBoxStrategy.Enabled = true;
Draw();
}
/// <summary>
/// Обработка нажатия кнопки "Создать Аеробус"
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
private void buttonCreateAirBus_Click(object sender, EventArgs e) => CreateObject(nameof(DrawingAirBus));
/// <summary>
/// Обработка нажатия кнопки "Создать самолёт"
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
private void buttonCreatePlane_Click(object sender, EventArgs e) => CreateObject(nameof(DrawingPlane));
private void ButtonMove_Click(object sender, EventArgs e)
{
if (_drawingPlane == null)
{
return;
}
string name = ((Button)sender)?.Name ?? String.Empty;
bool result = false;
switch (name)
{
case "buttonUp":
result = _drawingPlane.MoveTransport(DirectionType.Up);
break;
case "buttonDown":
result = _drawingPlane.MoveTransport(DirectionType.Down);
break;
case "buttonLeft":
result = _drawingPlane.MoveTransport(DirectionType.Left);
break;
case "buttonRight":
result = _drawingPlane.MoveTransport(DirectionType.Right);
break;
}
if (result)
{
Draw();
}
}
/// <summary>
/// Обработка нажатия кнопки "Шаг"
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
private void buttonStrategyStep_Click(object sender, EventArgs e)
{
if (_drawingPlane == null)
{
return;
}
if (comboBoxStrategy.Enabled)
{
_strategy = comboBoxStrategy.SelectedIndex switch
{
0 => new MoveToCenter(),
1 => new MoveToBorder(),
_ => null,
};
if (_strategy == null)
{
return;
}
_strategy.SetData(new MoveablePlane(_drawingPlane),
pictureBoxAirBus.Width, pictureBoxAirBus.Height);
}
if (_strategy == null)
{
return;
}
comboBoxStrategy.Enabled = false;
_strategy.MakeStep();
Draw();
if (_strategy.GetStatus() == StrategyStatus.Finish)
{
comboBoxStrategy.Enabled = true;
_strategy = null;
}
}
}

View File

@ -0,0 +1,294 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<assembly alias="System.Drawing" name="System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
<data name="buttonLeft.BackgroundImage" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>
/9j/4AAQSkZJRgABAQEAeAB4AAD/4QAiRXhpZgAATU0AKgAAAAgAAQESAAMAAAABAAEAAAAAAAD/2wBD
AAIBAQIBAQICAgICAgICAwUDAwMDAwYEBAMFBwYHBwcGBwcICQsJCAgKCAcHCg0KCgsMDAwMBwkODw0M
DgsMDAz/2wBDAQICAgMDAwYDAwYMCAcIDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwM
DAwMDAwMDAwMDAwMDAz/wAARCABkAGQDASIAAhEBAxEB/8QAHwAAAQUBAQEBAQEAAAAAAAAAAAECAwQF
BgcICQoL/8QAtRAAAgEDAwIEAwUFB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/8AfSgD8AaK/f7/AIgY/wDq6L/z
G/8A99KP+IGP/q6L/wAxv/8AfSgD8AaK/f7/AIgY/wDq6L/zG/8A99KP+IGP/q6L/wAxv/8AfSgD8AnX
YR7iiv6T/gn/AMGSfwX0DwrcQ/Eb4x/E/wAVa212zwXfhu2sfD9rHb7ECxtBPHes0gcSEyCVQQyjYCpZ
igD9rKKKKACvH/26P2Fvhx/wUW/Zy1n4YfE/Rv7V8P6ria3uISsd/ot4qsIr6zlKt5VxHvbDYKsrPG6v
FJJG3sFFAH8Uf/BVr/glF8R/+CS/7RsvgrxrF/avh/VfMuvCviq2t2jsPEtmrAF1BLeVcR7kWa3Zi0TO
pBkikhml+X6/uc/bo/YW+HH/AAUW/Zy1n4YfE/Rv7V8P6ria3uISsd/ot4qsIr6zlKt5VxHvbDYKsrPG
6vFJJG38gf8AwVa/4JRfEf8A4JL/ALRsvgrxrF/avh/VfMuvCviq2t2jsPEtmrAF1BLeVcR7kWa3Zi0T
OpBkikhmlAP1e/4MY/8Am6L/ALlT/wBzVfv9X4A/8GM3y/8ADUGOc/8ACKfh/wAhqv3+oAKKKKACiiig
AooooAKKKKACiiigArx79un9hj4cf8FFf2dNY+F/xP0b+1fD+rYmt7iErHf6LeKriK+s5SreVcR7mw2C
rK7xurxSSRsUUAfAP/Brh+xV4V/ZP/4bA/4R2/8AEF7/AGX8atT+HEX9pTwybtO0HP2OVtkSZuH/ALRm
81hhG2R7UTDbv1foooAKKKKACiiigAooooA//9k=
</value>
</data>
<data name="buttonUp.BackgroundImage" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>
/9j/4AAQSkZJRgABAQEAeAB4AAD/4QAiRXhpZgAATU0AKgAAAAgAAQESAAMAAAABAAEAAAAAAAD/2wBD
AAIBAQIBAQICAgICAgICAwUDAwMDAwYEBAMFBwYHBwcGBwcICQsJCAgKCAcHCg0KCgsMDAwMBwkODw0M
DgsMDAz/2wBDAQICAgMDAwYDAwY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K3Nw0dh4ls1YkIxAbyriPc7Q3CqWiZmBDxSTQygH9rdFeN/sM/t
1/Dr/gop+zno3xP+F+tDU/D+q5huLeeMJf6NeKqmWyvIlZvKuI9y5XJVlZJEZ4pI5GKAPyF+LH/Bk7/w
sn4p+JvEf/DU3iC6Ov6rdal5uveDP7W1WXzpnk3Xd5/aEf2m4O7Mk3lp5j7m2Lu2jn/+IGP/AKuh/wDM
b/8A30r9/qKAPwB/4gY/+rof/Mb/AP30r8Aa/v8AK/gDoAKKKKACiiigAr9AP+CGf/BDL/h9Cfijj4o/
8K2Hw1/snj/hG/7Z/tH7d9t/6erfy9n2P/a3eZ/Dt5/P+v3+/wCDGP8A5ui/7lT/ANzVAB/xAx/9XQ/+
Y3/++lH/ABAx/wDV0P8A5jf/AO+lfv8AUUAfk9+xZ/wa4n9k34W6h4c/4a//AGodL+26rJqXlfDfxB/w
helNuhhj3S2ebvzLj91hpvMG5BEuweXuYr9YaKACiiigAr+AOv7/ACv4A6ACiiigAooooAK/f7/gxj/5
ui/7lT/3NV+ANfv9/wAGMf8AzdF/3Kn/ALmqAP3+ooooAKKKKACiiigAr+AOv7/K/gDoAKKKKACiiigA
r9/v+DGP/m6L/uVP/c1X4A1+/wB/wYx/83Rf9yp/7mqAP3+ooooAKKKKACiiigAr+Fb9t74LaV+zR+2f
8XfhzoU9/d6J4B8a6z4b0+e/dJLqa3s76a3ieVkVEaQpGpYqigknCgcUUUAeWUUUUAFFFFABX9Jn/Bk1
8F9L8PfsX/GT4jQ3GoPrfinxnD4cu4HdPssdvptlFcQPGoUOJGfVLgOS5BCRYVSGLFFAH7YUUUUAFFFF
AH//2Q==
</value>
</data>
<data name="buttonDown.BackgroundImage" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>
/9j/4AAQSkZJRgABAQEAeAB4AAD/4QAiRXhpZgAATU0AKgAAAAgAAQESAAMAAAABAAEAAAAAAAD/2wBD
AAIBAQIBAQICAgICAgICAw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3/AMKA/sH9oT9oTQf+
Lgfu9Q8G+DdQg/5FTo0eoX0bD/kIdGigYf6Jw7j7TtW0/b8DFAGKKACiiigAooooAQjNePft0fsL/Dj/
AIKI/s5ax8L/AInaN/anh/VcTW1xBtjvtFu1VlivbSUq3lXEe5sHBVlZ43V4pJI29ipCM0AfxSf8FWf+
CUfxH/4JM/tHS+CvGsX9p+H9U8258K+Kra3aKx8S2asAXUEnyriPcizW5ZmiZlIaSKSGWT5fIxX9zX7d
H7C/w4/4KI/s5ax8L/ido39qeH9VxNbXEG2O+0W7VWWK9tJSreVcR7mwcFWVnjdXikkjb+QX/gq1/wAE
o/iP/wAEmf2jpfBXjWL+1PD+q+bc+FfFNtbtHY+JbNWALqCT5VxHuRZrcszRMykNJFJDNIAfL9KFzRsP
4V/R5/wbd/8ABt3/AMKA/sH9oT9oTQf+Lgfu9Q8G+DdQg/5FTo0eoX0bD/kIdGigYf6Jw7j7TtW0AD/g
27/4Nu/+FAf2D+0J+0JoP/FwP3eoeDfBuoQf8ip0aPUL6Nh/yEOjRQMP9E4dx9p2raft+BigDFFABRRR
QAUUUUAFFFFABRRRQAj8D8K8e/bm/YW+HH/BRT9m/Wvhh8T9G/tTw/qn762uICsV9ot4issV7ZylW8q4
j3NhsFWVnjdXikkjYooA/KL/AIN4f+CInwP8P/tHfGv4n6la6/4s8QfAL41+JPh94Qt9buLeextItOa0
NpqckSQp5moJ5smJCfKRisiQpJHHIn7fgYoooAKKKKACiiigAooooA//2Q==
</value>
</data>
<data name="buttonRight.BackgroundImage" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>
/9j/4AAQSkZJRgABAQEAeAB4AAD/4QAiRXhpZgAATU0AKgAAAAgAAQESAAMAAAABAAEAAAAAAAD/2wBD
AAIBAQIBAQICAgICAgICAwUDAwMDAwYEBAMFBwYHBwcGBwcICQsJCAgKCAcHCg0KCgsMDAwMBwkODw0M
DgsMDAz/2wBDAQICAgMDAwYDAw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KOadL+
JZpFQqGkWKMMQSEQEKKH/EDH/wBXQ/8AmN//AL6UAfgDRX7/AH/EDH/1dD/5jf8A++lH/EDH/wBXQ/8A
mN//AL6UAfgDRX7/AH/EDH/1dD/5jf8A++lH/EDLt/5ui/8AMb//AH0oA/AGilY5PPWkoAKcgzmhBnNf
0df8G4H/AAbeD9n86D+0J+0JoP8AxX+Y7/wb4N1CD/kVejR6hfRsP+Qh0aKFh/ovDuPtO1bQAP8Ag3A/
4NvB+z+dB/aE/aE0H/iv8x3/AIN8G6hB/wAir0aPUL6Nh/yEOjRQsP8AReHcfadq2n7fIMDrmhBgdc06
gAooooAKKKKACiiigAoboaKG6GgD+ANuppyDOaFGSa/o6/4NwP8Ag28H7P50H9oT9oTQf+K/zHf+DfBu
oQf8ir0aPUL6Nh/yEOjRQsP9F4dx9p2raAB/wbgf8G3g/Z/Og/tCftCaD/xX+Y7/AMG+DdQg/wCRV6NH
qF9Gw/5CHRooWH+i8O4+07VtP2+QYHXNCDA65p1ABRRRQAUUUUAFFFFABRRRQAU2U7QMetFFAH4g/wDB
vF/wRD+B+gftH/Gn4n6na+IPFmv/AAD+NfiT4feELfW7i3nsbSLTTaNaanJEkKeZqCeZJiQnykYrIkSS
xxyJ+3sB3RKx/iANFFAD6KKKACiiigAooooA/9k=
</value>
</data>
</root>

View File

@ -0,0 +1,142 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace AirBus.MovementStrategy;
/// <summary>
/// Класс-стратегия перемещения объекта
/// </summary>
public abstract class AbstractStrategy
{
/// <summary>
/// Перемещаемый объект
/// </summary>
private IMoveableObject? _moveableObject;
/// <summary>
/// Статус перемещения
/// </summary>
private StrategyStatus _state = StrategyStatus.NotInit;
/// <summary>
/// Ширина поля
/// </summary>
protected int FieldWidth { get; private set; }
/// <summary>
/// Высота поля
/// </summary>
protected int FieldHeight { get; private set; }
/// <summary>
/// Статус перемещения
/// </summary>
public StrategyStatus GetStatus() { return _state; }
/// <summary>
/// Установка данных
/// </summary>
/// <param name="moveableObject">Перемещаемый объект</param>
/// <param name="width">Ширина поля</param>
/// <param name="height">Высота поля</param>
public void SetData(IMoveableObject moveableObject, int width, int height)
{
if (moveableObject == null)
{
_state = StrategyStatus.NotInit;
return;
}
_state = StrategyStatus.InProgress;
_moveableObject = moveableObject;
FieldWidth = width;
FieldHeight = height;
}
/// <summary>
/// Шаг перемещения
/// </summary>
public void MakeStep()
{
if (_state != StrategyStatus.InProgress)
{
return;
}
if (IsTargetDestinaion())
{
_state = StrategyStatus.Finish;
return;
}
MoveToTarget();
}
/// <summary>
/// Перемещение влево
/// </summary>
/// <returns>Результат перемещения (true - удалось переместиться, false - неудача)</returns>
protected bool MoveLeft() => MoveTo(MovementDirection.Left);
/// <summary>
/// Перемещение вправо
/// </summary>
/// <returns>Результат перемещения (true - удалось переместиться, false - неудача)</returns>
protected bool MoveRight() => MoveTo(MovementDirection.Right);
/// <summary>
/// /// Перемещение вверх
/// </summary>
/// <returns>Результат перемещения (true - удалось переместиться, false - неудача)</returns>
protected bool MoveUp() => MoveTo(MovementDirection.Up);
/// <summary>
/// Перемещение вниз
/// </summary>
/// <returns>Результат перемещения (true - удалось переместиться, false - неудача)</returns>
protected bool MoveDown() => MoveTo(MovementDirection.Down);
/// <summary>
/// Параметры объекта
/// </summary>
protected ObjectParameters? GetObjectParameters =>
_moveableObject?.GetObjectPosition;
/// <summary>
/// Шаг объекта
/// </summary>
/// <returns></returns>
protected int? GetStep()
{
if (_state != StrategyStatus.InProgress)
{
return null;
}
return _moveableObject?.GetStep;
}
/// <summary>
/// Перемещение к цели
/// </summary>
protected abstract void MoveToTarget();
/// <summary>
/// Достигнута ли цель
/// </summary>
/// <returns></returns>
protected abstract bool IsTargetDestinaion();
/// <summary>
/// Попытка перемещения в требуемом направлении
/// </summary>
/// <param name="movementDirection">Направление</param>
/// <returns>Результат попытки (true - удалось переместиться, false - неудача)</returns>
private bool MoveTo(MovementDirection movementDirection)
{
if (_state != StrategyStatus.InProgress)
{
return false;
}
return _moveableObject?.TryMoveObject(movementDirection) ?? false;
}
}

View File

@ -0,0 +1,30 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace AirBus.MovementStrategy;
/// <summary>
/// Интерфейс для работы с перемещаемым объектом
/// </summary>
public interface IMoveableObject
{
/// <summary>
/// Получение координаты объекта
/// </summary>
ObjectParameters? GetObjectPosition { get; }
/// <summary>
/// Шаг объекта
/// </summary>
int GetStep { get; }
/// <summary>
/// Попытка переместить объект в указанном направлении
/// </summary>
/// <param name="direction">Направление</param>
/// <returns>true - объект перемещен, false - перемещение невозможно</returns>
bool TryMoveObject(MovementDirection direction);
}

View File

@ -0,0 +1,53 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace AirBus.MovementStrategy;
public class MoveToBorder : AbstractStrategy
{
protected override bool IsTargetDestinaion()
{
ObjectParameters? objParams = GetObjectParameters;
if (objParams == null)
{
return false;
}
return objParams.RightBorder + GetStep() >= FieldWidth
&& objParams.DownBorder + GetStep() >= FieldHeight;
}
protected override void MoveToTarget()
{
ObjectParameters? objParams = GetObjectParameters;
if (objParams == null)
{
return;
}
int diffX = objParams.RightBorder - FieldWidth;
if (Math.Abs(diffX) > GetStep())
{
if (diffX > 0)
{
MoveLeft();
}
else
{
MoveRight();
}
}
int diffY = objParams.DownBorder - FieldHeight;
if (Math.Abs(diffY) > GetStep())
{
if (diffY > 0)
{
MoveUp();
}
else
{
MoveDown();
}
}
}
}

View File

@ -0,0 +1,58 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace AirBus.MovementStrategy;
/// <summary>
/// Стратегия перемещения объекта в центр экрана
/// </summary>
public class MoveToCenter : AbstractStrategy
{
protected override bool IsTargetDestinaion()
{
ObjectParameters? objParams = GetObjectParameters;
if (objParams == null)
{
return false;
}
return objParams.ObjectMiddleHorizontal - GetStep() <= FieldWidth / 2
&& objParams.ObjectMiddleHorizontal + GetStep() >= FieldWidth / 2 &&
objParams.ObjectMiddleVertical - GetStep() <= FieldHeight / 2
&& objParams.ObjectMiddleVertical + GetStep() >= FieldHeight / 2;
}
protected override void MoveToTarget()
{
ObjectParameters? objParams = GetObjectParameters;
if (objParams == null)
{
return;
}
int diffX = objParams.ObjectMiddleHorizontal - FieldWidth / 2;
if (Math.Abs(diffX) > GetStep())
{
if (diffX > 0)
{
MoveLeft();
}
else
{
MoveRight();
}
}
int diffY = objParams.ObjectMiddleVertical - FieldHeight / 2;
if (Math.Abs(diffY) > GetStep())
{
if (diffY > 0)
{
MoveUp();
}
else
{
MoveDown();
}
}
}
}

View File

@ -0,0 +1,66 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using AirBus.Drawings;
namespace AirBus.MovementStrategy;
/// <summary>
/// Класс реализация IMoveableObject с использованияем DrawingPlane
/// </summary>
public class MoveablePlane : IMoveableObject
{
/// <summary>
/// Поле-объект класса DrawingPlane или его наследника
/// </summary>
private readonly DrawingPlane? _plane = null;
/// <summary>
/// Конструктор
/// </summary>
/// <param name="plane">Объект класса DrawingPlane</param>
public MoveablePlane(DrawingPlane plane)
{
_plane = plane;
}
public ObjectParameters? GetObjectPosition
{
get
{
if (_plane == null || _plane.EntityPlane == null || !_plane.GetPosX.HasValue || !_plane.GetPosY.HasValue)
{
return null;
}
return new ObjectParameters(_plane.GetPosX.Value,
_plane.GetPosY.Value, _plane.GetWidth, _plane.GetHeight);
}
}
public int GetStep => (int)(_plane?.EntityPlane?.Step ?? 0);
public bool TryMoveObject(MovementDirection direction)
{
if (_plane == null || _plane.EntityPlane == null)
{
return false;
}
return _plane.MoveTransport(GetDirectionType(direction));
}
/// <summary>
/// Конвертация из MovementDirection в DirectionType
/// </summary>
/// <param name="direction">MovementDirection</param>
/// <returns>DirectionType</returns>
private static DirectionType GetDirectionType(MovementDirection direction)
{
return direction switch
{
MovementDirection.Left => DirectionType.Left,
MovementDirection.Right => DirectionType.Right,
MovementDirection.Up => DirectionType.Up,
MovementDirection.Down => DirectionType.Down,
_ => DirectionType.Unknow,
};
}
}

View File

@ -0,0 +1,30 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace AirBus.MovementStrategy;
/// <summary>
/// Направление перемещения
/// </summary>
public enum MovementDirection
{
/// <summary>
/// Вверх
/// </summary>
Up = 1,
/// <summary>
/// Вниз
/// </summary>
Down = 2,
/// <summary>
/// Влево
/// </summary>
Left = 3,
/// <summary>
/// Вправо
/// </summary>
Right = 4
}

View File

@ -0,0 +1,68 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace AirBus.MovementStrategy;
/// <summary>
/// Параметры-координаты объекта
/// </summary>
public class ObjectParameters
{
/// <summary>
/// Координата X
/// </summary>
private readonly int _x;
/// <summary>
/// Координата Y
/// </summary>
private readonly int _y;
/// <summary>
/// Ширина объекта
/// </summary>
private readonly int _width;
/// <summary>
/// Высота объекта
/// </summary>
private readonly int _height;
/// <summary>
/// Левая граница
/// </summary>
public int LeftBorder => _x;
/// <summary>
/// Верхняя граница
/// </summary>
public int TopBorder => _y;
/// <summary>
/// Правая граница
/// </summary>
public int RightBorder => _x + _width;
/// <summary>
/// Нижняя граница
/// </summary>
public int DownBorder => _y + _height;
/// <summary>
/// Середина объекта
/// </summary>
public int ObjectMiddleHorizontal => _x + _width / 2;
/// <summary>
/// Середина объекта
/// </summary>
public int ObjectMiddleVertical => _y + _height / 2;
/// <summary>
/// Конструктор
/// </summary>
/// <param name="x">Координата X</param>
/// <param name="y">Координата Y</param>
/// <param name="width">Ширина объекта</param>
/// <param name="height">Высота объекта</param>
public ObjectParameters(int x, int y, int width, int height)
{
_x = x;
_y = y;
_width = width;
_height = height;
}
}

View File

@ -0,0 +1,26 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace AirBus.MovementStrategy;
/// <summary>
/// Статус выполнения операции перемещения
/// </summary>
public enum StrategyStatus
{
/// <summary>
/// Все готово к началу
/// </summary>
NotInit,
/// <summary>
/// Выполняется
/// </summary>
InProgress,
/// <summary>
/// Завершено
/// </summary>
Finish
}

View File

@ -1,4 +1,4 @@
namespace ProjectA
namespace AirBus
{
internal static class Program
{
@ -11,7 +11,7 @@ namespace ProjectA
// To customize application configuration such as set high DPI settings or default font,
// see https://aka.ms/applicationconfiguration.
ApplicationConfiguration.Initialize();
Application.Run(new Form1());
Application.Run(new FormAirBus());
}
}
}

View File

@ -0,0 +1,63 @@
//------------------------------------------------------------------------------
// <auto-generated>
// Этот код создан программой.
// Исполняемая версия:4.0.30319.42000
//
// Изменения в этом файле могут привести к неправильной работе и будут потеряны в случае
// повторной генерации кода.
// </auto-generated>
//------------------------------------------------------------------------------
namespace AirBus.Properties {
using System;
/// <summary>
/// Класс ресурса со строгой типизацией для поиска локализованных строк и т.д.
/// </summary>
// Этот класс создан автоматически классом StronglyTypedResourceBuilder
// с помощью такого средства, как ResGen или Visual Studio.
// Чтобы добавить или удалить член, измените файл .ResX и снова запустите ResGen
// с параметром /str или перестройте свой проект VS.
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "17.0.0.0")]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
internal class Resources {
private static global::System.Resources.ResourceManager resourceMan;
private static global::System.Globalization.CultureInfo resourceCulture;
[global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
internal Resources() {
}
/// <summary>
/// Возвращает кэшированный экземпляр ResourceManager, использованный этим классом.
/// </summary>
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
internal static global::System.Resources.ResourceManager ResourceManager {
get {
if (object.ReferenceEquals(resourceMan, null)) {
global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("AirBus.Properties.Resources", typeof(Resources).Assembly);
resourceMan = temp;
}
return resourceMan;
}
}
/// <summary>
/// Перезаписывает свойство CurrentUICulture текущего потока для всех
/// обращений к ресурсу с помощью этого класса ресурса со строгой типизацией.
/// </summary>
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
internal static global::System.Globalization.CultureInfo Culture {
get {
return resourceCulture;
}
set {
resourceCulture = value;
}
}
}
}

BIN
AirBus/Pictures/arrow.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.3 KiB

View File

@ -1,39 +0,0 @@
namespace ProjectA
{
partial class Form1
{
/// <summary>
/// Required designer variable.
/// </summary>
private System.ComponentModel.IContainer components = null;
/// <summary>
/// Clean up any resources being used.
/// </summary>
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
{
components.Dispose();
}
base.Dispose(disposing);
}
#region Windows Form Designer generated code
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent()
{
this.components = new System.ComponentModel.Container();
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(800, 450);
this.Text = "Form1";
}
#endregion
}
}

View File

@ -1,10 +0,0 @@
namespace ProjectA
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
}
}

View File

@ -1,11 +0,0 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>WinExe</OutputType>
<TargetFramework>net8.0-windows</TargetFramework>
<Nullable>enable</Nullable>
<UseWindowsForms>true</UseWindowsForms>
<ImplicitUsings>enable</ImplicitUsings>
</PropertyGroup>
</Project>