diff --git a/ProjectAircraftCarrier/ProjectAircraftCarrier/ProjectAircraftCarrier1.csproj b/ProjectAircraftCarrier/ProjectAircraftCarrier/ProjectAircraftCarrier1.csproj
new file mode 100644
index 0000000..af03d74
--- /dev/null
+++ b/ProjectAircraftCarrier/ProjectAircraftCarrier/ProjectAircraftCarrier1.csproj
@@ -0,0 +1,26 @@
+
+
+
+ WinExe
+ net8.0-windows
+ enable
+ true
+ enable
+
+
+
+
+ True
+ True
+ Resources.resx
+
+
+
+
+
+ ResXFileCodeGenerator
+ Resources.Designer.cs
+
+
+
+
\ No newline at end of file
diff --git a/ProjectAircraftCarrier/ProjectAircraftCarrier1.sln b/ProjectAircraftCarrier/ProjectAircraftCarrier1.sln
new file mode 100644
index 0000000..0eb21b9
--- /dev/null
+++ b/ProjectAircraftCarrier/ProjectAircraftCarrier1.sln
@@ -0,0 +1,25 @@
+
+Microsoft Visual Studio Solution File, Format Version 12.00
+# Visual Studio Version 17
+VisualStudioVersion = 17.8.34525.116
+MinimumVisualStudioVersion = 10.0.40219.1
+Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ProjectAircraftCarrier1", "ProjectAircraftCarrier\ProjectAircraftCarrier1.csproj", "{A871246D-86F2-4370-B644-24A99BFF6783}"
+EndProject
+Global
+ GlobalSection(SolutionConfigurationPlatforms) = preSolution
+ Debug|Any CPU = Debug|Any CPU
+ Release|Any CPU = Release|Any CPU
+ EndGlobalSection
+ GlobalSection(ProjectConfigurationPlatforms) = postSolution
+ {A871246D-86F2-4370-B644-24A99BFF6783}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {A871246D-86F2-4370-B644-24A99BFF6783}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {A871246D-86F2-4370-B644-24A99BFF6783}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {A871246D-86F2-4370-B644-24A99BFF6783}.Release|Any CPU.Build.0 = Release|Any CPU
+ EndGlobalSection
+ GlobalSection(SolutionProperties) = preSolution
+ HideSolutionNode = FALSE
+ EndGlobalSection
+ GlobalSection(ExtensibilityGlobals) = postSolution
+ SolutionGuid = {7F4937DC-FEE0-4D3B-8062-6479A5B07CE4}
+ EndGlobalSection
+EndGlobal
diff --git a/ProjectAircraftCarrier_/ProjectAircraftCarrier_.sln b/ProjectAircraftCarrier_/ProjectAircraftCarrier_.sln
new file mode 100644
index 0000000..6a256d3
--- /dev/null
+++ b/ProjectAircraftCarrier_/ProjectAircraftCarrier_.sln
@@ -0,0 +1,25 @@
+
+Microsoft Visual Studio Solution File, Format Version 12.00
+# Visual Studio Version 17
+VisualStudioVersion = 17.8.34601.278
+MinimumVisualStudioVersion = 10.0.40219.1
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ProjectAircraftCarrier_", "ProjectAircraftCarrier_\ProjectAircraftCarrier_.csproj", "{9D47B714-02FD-4D16-8FD1-7CC43F92533E}"
+EndProject
+Global
+ GlobalSection(SolutionConfigurationPlatforms) = preSolution
+ Debug|Any CPU = Debug|Any CPU
+ Release|Any CPU = Release|Any CPU
+ EndGlobalSection
+ GlobalSection(ProjectConfigurationPlatforms) = postSolution
+ {9D47B714-02FD-4D16-8FD1-7CC43F92533E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {9D47B714-02FD-4D16-8FD1-7CC43F92533E}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {9D47B714-02FD-4D16-8FD1-7CC43F92533E}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {9D47B714-02FD-4D16-8FD1-7CC43F92533E}.Release|Any CPU.Build.0 = Release|Any CPU
+ EndGlobalSection
+ GlobalSection(SolutionProperties) = preSolution
+ HideSolutionNode = FALSE
+ EndGlobalSection
+ GlobalSection(ExtensibilityGlobals) = postSolution
+ SolutionGuid = {0384B21C-1A79-4855-A419-87A2504E0670}
+ EndGlobalSection
+EndGlobal
diff --git a/ProjectAircraftCarrier_/ProjectAircraftCarrier_/DirectionType.cs b/ProjectAircraftCarrier_/ProjectAircraftCarrier_/DirectionType.cs
new file mode 100644
index 0000000..387517b
--- /dev/null
+++ b/ProjectAircraftCarrier_/ProjectAircraftCarrier_/DirectionType.cs
@@ -0,0 +1,27 @@
+namespace ProjectAircraftCarrier;
+
+///
+/// Направление перемещения
+///
+public enum DirectionType
+{
+ ///
+ /// Вверх
+ ///
+ Up = 1,
+
+ ///
+ /// Вниз
+ ///
+ Down = 2,
+
+ ///
+ /// Влево
+ ///
+ Left = 3,
+
+ ///
+ /// Вправо
+ ///
+ Right = 4
+}
\ No newline at end of file
diff --git a/ProjectAircraftCarrier_/ProjectAircraftCarrier_/DrawningAircraftCarrier.cs b/ProjectAircraftCarrier_/ProjectAircraftCarrier_/DrawningAircraftCarrier.cs
new file mode 100644
index 0000000..064b101
--- /dev/null
+++ b/ProjectAircraftCarrier_/ProjectAircraftCarrier_/DrawningAircraftCarrier.cs
@@ -0,0 +1,248 @@
+namespace ProjectAircraftCarrier;
+
+internal class DrawningAircraftCarrier
+{
+ ///
+ /// Класс-сущность
+ ///
+ public EntityAircraftCarrier? EntityAircraftCarrier { get; private set; }
+
+ ///
+ /// Ширина окна
+ ///
+ private int? _pictureWidth;
+
+ ///
+ /// Высота окна
+ ///
+ private int? _pictureHeight;
+
+ ///
+ /// Левая координата прорисовки авианосца
+ ///
+ private int? _startPosX;
+
+ ///
+ /// Верхняя координата прорисовки авианосца
+ ///
+ private int? _startPosY;
+
+ ///
+ /// Ширина прорисовки авианосца
+ ///
+ private readonly int _drawningAircraftCarrierWidth = 140;
+
+ ///
+ /// Высота прорисовки авианосца
+ ///
+ private readonly int _drawningAircraftCarrierHeight = 50;
+
+ ///
+ /// Инициализация полей объекта-класса авианосца
+ ///
+ /// Скорость
+ /// Вес
+ /// Основной цвет
+ /// Дополнительный цвет
+ /// Палуба для взлета самолетов
+ /// Рубка управления
+ /// Истребитель
+ public void Init(int speed, double weight, Color bodyColor, Color additionalColor, bool deckForAircraftTakeOff, bool controlCabin, bool fighterJet)
+ {
+ EntityAircraftCarrier = new EntityAircraftCarrier();
+ EntityAircraftCarrier.Init(speed, weight, bodyColor, additionalColor, deckForAircraftTakeOff, controlCabin, fighterJet);
+ _pictureWidth = null;
+ _pictureHeight = null;
+ _startPosX = null;
+ _startPosY = null;
+ }
+
+ ///
+ /// Установка границ поля
+ ///
+ /// Ширина поля
+ /// Высота поля
+ /// true - границы заданы, false - проверка не пройдена, нельзя разместить объект в этих размерах
+ public bool SetPictureSize(int width, int height)
+ {
+ // TODO проверка, что объект "влезает" в размеры поля
+ // если влезает, сохраняем границы и корректируем позицию объекта, если она была уже установлена
+ if (_drawningAircraftCarrierWidth <= width && _drawningAircraftCarrierHeight <= height)
+ {
+ _pictureWidth = width;
+ _pictureHeight = height;
+ if (_startPosX.HasValue && _startPosY.HasValue)
+ {
+ if (_startPosX + _drawningAircraftCarrierWidth > width)
+ {
+ _startPosX = width - _drawningAircraftCarrierWidth;
+ }
+
+ if (_startPosY + _drawningAircraftCarrierHeight > height)
+ {
+ _startPosY = height - _drawningAircraftCarrierHeight;
+ }
+ }
+ return true;
+ }
+ return false;
+ }
+
+ ///
+ /// Установка позиции
+ ///
+ /// Координата X
+ /// Координата Y
+ public void SetPosition(int x, int y)
+ {
+ if (!_pictureHeight.HasValue || !_pictureWidth.HasValue)
+ {
+ return;
+ }
+
+ // TODO если при установке объекта в эти координаты, он будет "выходить" за границы формы
+ // то надо изменить координаты, чтобы он оставался в этих границах
+ _startPosX = x;
+ _startPosY = y;
+ if (x < 0)
+ {
+ _startPosX = 0;
+ }
+
+ if (y < 0)
+ {
+ _startPosY = 0;
+ }
+
+ if (x + _drawningAircraftCarrierWidth > _pictureWidth)
+ {
+ _startPosX = _pictureWidth - _drawningAircraftCarrierWidth;
+ }
+
+ if (y + _drawningAircraftCarrierHeight > _pictureHeight)
+ {
+ _startPosY = _pictureHeight - _drawningAircraftCarrierHeight;
+ }
+ }
+
+ public bool MoveTransport(DirectionType direction)
+ {
+ if (EntityAircraftCarrier == null || !_startPosX.HasValue || !_startPosY.HasValue)
+ {
+ return false;
+ }
+
+ switch (direction)
+ {
+ // Влево
+ case DirectionType.Left:
+ if (_startPosX.Value - EntityAircraftCarrier.Step > 0)
+ {
+ _startPosX -= (int)EntityAircraftCarrier.Step;
+ }
+ return true;
+ // Вверх
+ case DirectionType.Up:
+ if (_startPosY.Value - EntityAircraftCarrier.Step > 0)
+ {
+ _startPosY -= (int)EntityAircraftCarrier.Step;
+ }
+ return true;
+ // Вправо
+ case DirectionType.Right:
+ //TODO прописать логику сдвига в право
+ if (_startPosX.Value + _drawningAircraftCarrierWidth + EntityAircraftCarrier.Step < _pictureWidth.Value)
+ {
+ _startPosX += (int)EntityAircraftCarrier.Step;
+ }
+ return true;
+ // Вниз
+ case DirectionType.Down:
+ //TODO прописать логику сдвига в вниз
+ if (_startPosY.Value + _drawningAircraftCarrierHeight + EntityAircraftCarrier.Step < _pictureHeight.Value)
+ {
+ _startPosY += (int)EntityAircraftCarrier.Step;
+ }
+ return true;
+ default:
+ return false;
+ }
+ }
+
+ ///
+ /// Прорисовка объекта
+ ///
+ ///
+ public void DrawTransport(Graphics g)
+ {
+ if (EntityAircraftCarrier == null || !_startPosX.HasValue || !_startPosY.HasValue)
+ {
+ return;
+ }
+
+ Pen pen = new(Color.Black);
+ Brush additionalBrush = new SolidBrush(EntityAircraftCarrier.AdditionalColor);
+ Pen additionalPen = new(EntityAircraftCarrier.AdditionalColor, 2);
+
+ // Границы авианосца
+ g.DrawRectangle(pen, _startPosX.Value + 5, _startPosY.Value, 100, 50);
+ g.DrawRectangle(pen, _startPosX.Value, _startPosY.Value + 5, 5, 15);
+ g.DrawRectangle(pen, _startPosX.Value, _startPosY.Value + 30, 5, 15);
+
+ Point[] points =
+ {
+ new Point(_startPosX.Value + 105, _startPosY.Value),
+ new Point(_startPosX.Value + 120, _startPosY.Value + 15),
+ new Point(_startPosX.Value + 140, _startPosY.Value + 20),
+ new Point(_startPosX.Value + 140, _startPosY.Value + 30),
+ new Point(_startPosX.Value + 120, _startPosY.Value + 35),
+ new Point(_startPosX.Value + 105, _startPosY.Value + 50),
+
+ };
+ g.DrawPolygon(pen, points);
+
+ // Палуба
+ Brush br = new SolidBrush(EntityAircraftCarrier.BodyColor);
+ Brush brBlack = new SolidBrush(Color.Black);
+ g.FillRectangle(br, _startPosX.Value + 6, _startPosY.Value + 1, 100, 49);
+ g.FillPolygon(br, points);
+ g.FillRectangle(brBlack, _startPosX.Value, _startPosY.Value + 5, 5, 15);
+ g.FillRectangle(brBlack, _startPosX.Value, _startPosY.Value + 30, 5, 15);
+
+ // Палуба для взлёта самолётов
+ if (EntityAircraftCarrier.DeckForAircraftTakeOff)
+ {
+ Pen penYellow = new(Color.Yellow);
+
+ Point[] addPoints =
+ {
+ new Point(_startPosX.Value + 5, _startPosY.Value + 10),
+ new Point(_startPosX.Value + 105, _startPosY.Value),
+ new Point(_startPosX.Value + 120, _startPosY.Value + 15),
+ new Point(_startPosX.Value + 5, _startPosY.Value + 30),
+
+ };
+ g.DrawPolygon(pen, addPoints);
+ g.FillPolygon(additionalBrush, addPoints);
+ // Разметка
+ g.DrawLine(penYellow, _startPosX.Value + 10, _startPosY.Value + 20, _startPosX.Value + 105, _startPosY.Value + 8);
+ }
+
+ // Рубка
+ if (EntityAircraftCarrier.ControlCabin)
+ {
+ g.DrawEllipse(pen, _startPosX.Value + 40, _startPosY.Value + 35, 30, 10);
+ g.FillEllipse(additionalBrush, _startPosX.Value + 40, _startPosY.Value + 35, 30, 10);
+ }
+
+ // Истребитель
+ if (EntityAircraftCarrier.FighterJet)
+ {
+ g.DrawLine(additionalPen, _startPosX.Value + 95, _startPosY.Value + 27, _startPosX.Value + 95, _startPosY.Value + 47);
+ g.DrawLine(additionalPen, _startPosX.Value + 85, _startPosY.Value + 42, _startPosX.Value + 95, _startPosY.Value + 32);
+ g.DrawLine(additionalPen, _startPosX.Value + 95, _startPosY.Value + 32, _startPosX.Value + 105, _startPosY.Value + 42);
+ g.DrawLine(additionalPen, _startPosX.Value + 90, _startPosY.Value + 46, _startPosX.Value + 95, _startPosY.Value + 41);
+ g.DrawLine(additionalPen, _startPosX.Value + 95, _startPosY.Value + 41, _startPosX.Value + 100, _startPosY.Value + 46);
+ }
+ }
+}
\ No newline at end of file
diff --git a/ProjectAircraftCarrier_/ProjectAircraftCarrier_/EntityAircraftCarrier.cs b/ProjectAircraftCarrier_/ProjectAircraftCarrier_/EntityAircraftCarrier.cs
new file mode 100644
index 0000000..d4e84bf
--- /dev/null
+++ b/ProjectAircraftCarrier_/ProjectAircraftCarrier_/EntityAircraftCarrier.cs
@@ -0,0 +1,68 @@
+namespace ProjectAircraftCarrier;
+
+///
+/// Класс-сущность "Авианосец"
+///
+public class EntityAircraftCarrier
+{
+ ///
+ /// Скорость
+ ///
+ public int Speed { get; private set; }
+
+ ///
+ /// Вес
+ ///
+ public double Weight { get; private set; }
+
+ ///
+ /// Основной цвет
+ ///
+ public Color BodyColor { get; private set; }
+
+ ///
+ /// Дополнительный цвет (для опциональных элементов)
+ ///
+ public Color AdditionalColor { get; private set; }
+
+ ///
+ /// Признак (опция) наличия палубы для взлета самолетов
+ ///
+ public bool DeckForAircraftTakeOff { get; private set; }
+
+ ///
+ /// Признак (опция) наличия рубки управления
+ ///
+ public bool ControlCabin { get; private set; }
+
+ ///
+ /// Признак (опция) наличия истребителя
+ ///
+ public bool FighterJet { get; private set; }
+
+ ///
+ /// Шаг перемещения авианосца
+ ///
+ public double Step => Speed * 100 / Weight;
+
+ ///
+ /// Инициализация полей объекта-класса авианосца
+ ///
+ /// Скорость
+ /// Вес
+ /// Основной цвет
+ /// Дополнительный цвет
+ /// Признак наличия рубки управления
+ /// Признак наличия рубки управления
+ /// Признак наличия истребителя
+ public void Init(int speed, double weight, Color bodyColor, Color additionalColor, bool deckForAircraftTakeOff, bool controlCabin, bool fighterJet)
+ {
+ Speed = speed;
+ Weight = weight;
+ BodyColor = bodyColor;
+ AdditionalColor = additionalColor;
+ DeckForAircraftTakeOff = deckForAircraftTakeOff;
+ ControlCabin = controlCabin;
+ FighterJet = fighterJet;
+ }
+}
\ No newline at end of file
diff --git a/ProjectAircraftCarrier_/ProjectAircraftCarrier_/FormAircraftCarrier.Designer.cs b/ProjectAircraftCarrier_/ProjectAircraftCarrier_/FormAircraftCarrier.Designer.cs
new file mode 100644
index 0000000..910ee0a
--- /dev/null
+++ b/ProjectAircraftCarrier_/ProjectAircraftCarrier_/FormAircraftCarrier.Designer.cs
@@ -0,0 +1,134 @@
+namespace ProjectAircraftCarrier_
+{
+ partial class FormAircraftCarrier
+ {
+ ///
+ /// Required designer variable.
+ ///
+ private System.ComponentModel.IContainer components = null;
+
+ ///
+ /// Clean up any resources being used.
+ ///
+ /// true if managed resources should be disposed; otherwise, false.
+ protected override void Dispose(bool disposing)
+ {
+ if (disposing && (components != null))
+ {
+ components.Dispose();
+ }
+ base.Dispose(disposing);
+ }
+
+ #region Windows Form Designer generated code
+
+ ///
+ /// Required method for Designer support - do not modify
+ /// the contents of this method with the code editor.
+ ///
+ private void InitializeComponent()
+ {
+ pictureBoxAircraftCarrier = new PictureBox();
+ buttonCreateAircraftCarrier = new Button();
+ buttonLeft = new Button();
+ buttonDown = new Button();
+ buttonRight = new Button();
+ buttonUp = new Button();
+ ((System.ComponentModel.ISupportInitialize)pictureBoxAircraftCarrier).BeginInit();
+ SuspendLayout();
+ //
+ // pictureBoxAircraftCarrier
+ //
+ pictureBoxAircraftCarrier.Dock = DockStyle.Fill;
+ pictureBoxAircraftCarrier.Location = new Point(0, 0);
+ pictureBoxAircraftCarrier.Name = "pictureBoxAircraftCarrier";
+ pictureBoxAircraftCarrier.Size = new Size(1167, 653);
+ pictureBoxAircraftCarrier.TabIndex = 0;
+ pictureBoxAircraftCarrier.TabStop = false;
+ //
+ // buttonCreateAircraftCarrier
+ //
+ buttonCreateAircraftCarrier.Anchor = AnchorStyles.Bottom | AnchorStyles.Left;
+ buttonCreateAircraftCarrier.Location = new Point(12, 601);
+ buttonCreateAircraftCarrier.Name = "buttonCreateAircraftCarrier";
+ buttonCreateAircraftCarrier.Size = new Size(131, 40);
+ buttonCreateAircraftCarrier.TabIndex = 1;
+ buttonCreateAircraftCarrier.Text = "Создать";
+ buttonCreateAircraftCarrier.UseVisualStyleBackColor = true;
+ buttonCreateAircraftCarrier.Click += ButtonCreateAircraftCarrier_Click;
+ //
+ // buttonLeft
+ //
+ buttonLeft.Anchor = AnchorStyles.Bottom | AnchorStyles.Right;
+ buttonLeft.BackgroundImage = Properties.Resources.arrowLeft;
+ buttonLeft.BackgroundImageLayout = ImageLayout.Stretch;
+ buttonLeft.Location = new Point(1030, 606);
+ buttonLeft.Name = "buttonLeft";
+ buttonLeft.Size = new Size(35, 35);
+ buttonLeft.TabIndex = 2;
+ buttonLeft.UseVisualStyleBackColor = true;
+ buttonLeft.Click += ButtonMove_Click;
+ //
+ // buttonDown
+ //
+ buttonDown.Anchor = AnchorStyles.Bottom | AnchorStyles.Right;
+ buttonDown.BackgroundImage = Properties.Resources.arrowDown;
+ buttonDown.BackgroundImageLayout = ImageLayout.Stretch;
+ buttonDown.Location = new Point(1071, 606);
+ buttonDown.Name = "buttonDown";
+ buttonDown.Size = new Size(35, 35);
+ buttonDown.TabIndex = 3;
+ buttonDown.UseVisualStyleBackColor = true;
+ buttonDown.Click += ButtonMove_Click;
+ //
+ // buttonRight
+ //
+ buttonRight.Anchor = AnchorStyles.Bottom | AnchorStyles.Right;
+ buttonRight.BackgroundImage = Properties.Resources.arrowRight;
+ buttonRight.BackgroundImageLayout = ImageLayout.Stretch;
+ buttonRight.Location = new Point(1112, 606);
+ buttonRight.Name = "buttonRight";
+ buttonRight.Size = new Size(35, 35);
+ buttonRight.TabIndex = 4;
+ buttonRight.UseVisualStyleBackColor = true;
+ buttonRight.Click += ButtonMove_Click;
+ //
+ // buttonUp
+ //
+ buttonUp.Anchor = AnchorStyles.Bottom | AnchorStyles.Right;
+ buttonUp.BackgroundImage = Properties.Resources.arrowUp;
+ buttonUp.BackgroundImageLayout = ImageLayout.Stretch;
+ buttonUp.Location = new Point(1071, 565);
+ buttonUp.Name = "buttonUp";
+ buttonUp.Size = new Size(35, 35);
+ buttonUp.TabIndex = 5;
+ buttonUp.UseVisualStyleBackColor = true;
+ buttonUp.Click += ButtonMove_Click;
+ //
+ // FormAircraftCarrier
+ //
+ AutoScaleDimensions = new SizeF(12F, 30F);
+ AutoScaleMode = AutoScaleMode.Font;
+ ClientSize = new Size(1167, 653);
+ Controls.Add(buttonUp);
+ Controls.Add(buttonRight);
+ Controls.Add(buttonDown);
+ Controls.Add(buttonLeft);
+ Controls.Add(buttonCreateAircraftCarrier);
+ Controls.Add(pictureBoxAircraftCarrier);
+ Name = "FormAircraftCarrier";
+ Text = "Авианосец";
+ ((System.ComponentModel.ISupportInitialize)pictureBoxAircraftCarrier).EndInit();
+ ResumeLayout(false);
+ }
+
+ #endregion
+
+ private PictureBox pictureBoxAircraftCarrier;
+ private Button buttonCreateAircraftCarrier;
+ private Button buttonLeft;
+ private Button buttonDown;
+ private Button buttonRight;
+ private Button buttonUp;
+ }
+}
\ No newline at end of file
diff --git a/ProjectAircraftCarrier_/ProjectAircraftCarrier_/FormAircraftCarrier.cs b/ProjectAircraftCarrier_/ProjectAircraftCarrier_/FormAircraftCarrier.cs
new file mode 100644
index 0000000..df50c97
--- /dev/null
+++ b/ProjectAircraftCarrier_/ProjectAircraftCarrier_/FormAircraftCarrier.cs
@@ -0,0 +1,97 @@
+using ProjectAircraftCarrier;
+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;
+
+namespace ProjectAircraftCarrier_
+{
+ public partial class FormAircraftCarrier : Form
+ {
+ ///
+ /// Поле-объект для прорисовки объекта
+ ///
+ private DrawningAircraftCarrier? _drawningAircraftCarrier;
+ public FormAircraftCarrier()
+ {
+ InitializeComponent();
+ }
+
+ ///
+ /// Метод прорисовки машины
+ ///
+ private void Draw()
+ {
+ if (_drawningAircraftCarrier == null)
+ {
+ return;
+ }
+
+ Bitmap bmp = new(pictureBoxAircraftCarrier.Width, pictureBoxAircraftCarrier.Height);
+ Graphics gr = Graphics.FromImage(bmp);
+ _drawningAircraftCarrier.DrawTransport(gr);
+ pictureBoxAircraftCarrier.Image = bmp;
+
+ }
+
+ ///
+ /// Обработка нажатия кнопки создать
+ ///
+ ///
+ ///
+ private void ButtonCreateAircraftCarrier_Click(object sender, EventArgs e)
+ {
+ Random random = new();
+ _drawningAircraftCarrier = new DrawningAircraftCarrier();
+ _drawningAircraftCarrier.Init(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)), Convert.ToBoolean(random.Next(0, 2)));
+ _drawningAircraftCarrier.SetPictureSize(pictureBoxAircraftCarrier.Width, pictureBoxAircraftCarrier.Height);
+ _drawningAircraftCarrier.SetPosition(random.Next(10, 100), random.Next(10, 100));
+
+ Draw();
+ }
+
+ ///
+ /// Перемещение объекта по форме (нажатие кнопок навигации)
+ ///
+ ///
+ ///
+ private void ButtonMove_Click(object sender, EventArgs e)
+ {
+ if (_drawningAircraftCarrier == null)
+ {
+ return;
+ }
+
+ string name = ((Button)sender)?.Name ?? string.Empty;
+ bool result = false;
+ switch (name)
+ {
+ case "buttonUp":
+ result = _drawningAircraftCarrier.MoveTransport(DirectionType.Up);
+ break;
+ case "buttonDown":
+ result = _drawningAircraftCarrier.MoveTransport(DirectionType.Down);
+ break;
+ case "buttonLeft":
+ result = _drawningAircraftCarrier.MoveTransport(DirectionType.Left);
+ break;
+ case "buttonRight":
+ result = _drawningAircraftCarrier.MoveTransport(DirectionType.Right);
+ break;
+ }
+
+ if (result)
+ {
+ Draw();
+ }
+ }
+ }
+}
diff --git a/ProjectAircraftCarrier_/ProjectAircraftCarrier_/FormAircraftCarrier.resx b/ProjectAircraftCarrier_/ProjectAircraftCarrier_/FormAircraftCarrier.resx
new file mode 100644
index 0000000..af32865
--- /dev/null
+++ b/ProjectAircraftCarrier_/ProjectAircraftCarrier_/FormAircraftCarrier.resx
@@ -0,0 +1,120 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ text/microsoft-resx
+
+
+ 2.0
+
+
+ System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
+
+
+ System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
+
+
\ No newline at end of file
diff --git a/ProjectAircraftCarrier_/ProjectAircraftCarrier_/Program.cs b/ProjectAircraftCarrier_/ProjectAircraftCarrier_/Program.cs
new file mode 100644
index 0000000..a84e56d
--- /dev/null
+++ b/ProjectAircraftCarrier_/ProjectAircraftCarrier_/Program.cs
@@ -0,0 +1,17 @@
+namespace ProjectAircraftCarrier_
+{
+ internal static class Program
+ {
+ ///
+ /// The main entry point for the application.
+ ///
+ [STAThread]
+ static void Main()
+ {
+ // To customize application configuration such as set high DPI settings or default font,
+ // see https://aka.ms/applicationconfiguration.
+ ApplicationConfiguration.Initialize();
+ Application.Run(new FormAircraftCarrier());
+ }
+ }
+}
\ No newline at end of file
diff --git a/ProjectAircraftCarrier_/ProjectAircraftCarrier_/ProjectAircraftCarrier_.csproj b/ProjectAircraftCarrier_/ProjectAircraftCarrier_/ProjectAircraftCarrier_.csproj
new file mode 100644
index 0000000..af03d74
--- /dev/null
+++ b/ProjectAircraftCarrier_/ProjectAircraftCarrier_/ProjectAircraftCarrier_.csproj
@@ -0,0 +1,26 @@
+
+
+
+ WinExe
+ net8.0-windows
+ enable
+ true
+ enable
+
+
+
+
+ True
+ True
+ Resources.resx
+
+
+
+
+
+ ResXFileCodeGenerator
+ Resources.Designer.cs
+
+
+
+
\ No newline at end of file
diff --git a/ProjectAircraftCarrier_/ProjectAircraftCarrier_/Properties/Resources.Designer.cs b/ProjectAircraftCarrier_/ProjectAircraftCarrier_/Properties/Resources.Designer.cs
new file mode 100644
index 0000000..7d74f48
--- /dev/null
+++ b/ProjectAircraftCarrier_/ProjectAircraftCarrier_/Properties/Resources.Designer.cs
@@ -0,0 +1,103 @@
+//------------------------------------------------------------------------------
+//
+// Этот код создан программой.
+// Исполняемая версия:4.0.30319.42000
+//
+// Изменения в этом файле могут привести к неправильной работе и будут потеряны в случае
+// повторной генерации кода.
+//
+//------------------------------------------------------------------------------
+
+namespace ProjectAircraftCarrier_.Properties {
+ using System;
+
+
+ ///
+ /// Класс ресурса со строгой типизацией для поиска локализованных строк и т.д.
+ ///
+ // Этот класс создан автоматически классом 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() {
+ }
+
+ ///
+ /// Возвращает кэшированный экземпляр ResourceManager, использованный этим классом.
+ ///
+ [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("ProjectAircraftCarrier_.Properties.Resources", typeof(Resources).Assembly);
+ resourceMan = temp;
+ }
+ return resourceMan;
+ }
+ }
+
+ ///
+ /// Перезаписывает свойство CurrentUICulture текущего потока для всех
+ /// обращений к ресурсу с помощью этого класса ресурса со строгой типизацией.
+ ///
+ [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
+ internal static global::System.Globalization.CultureInfo Culture {
+ get {
+ return resourceCulture;
+ }
+ set {
+ resourceCulture = value;
+ }
+ }
+
+ ///
+ /// Поиск локализованного ресурса типа System.Drawing.Bitmap.
+ ///
+ internal static System.Drawing.Bitmap arrowDown {
+ get {
+ object obj = ResourceManager.GetObject("arrowDown", resourceCulture);
+ return ((System.Drawing.Bitmap)(obj));
+ }
+ }
+
+ ///
+ /// Поиск локализованного ресурса типа System.Drawing.Bitmap.
+ ///
+ internal static System.Drawing.Bitmap arrowLeft {
+ get {
+ object obj = ResourceManager.GetObject("arrowLeft", resourceCulture);
+ return ((System.Drawing.Bitmap)(obj));
+ }
+ }
+
+ ///
+ /// Поиск локализованного ресурса типа System.Drawing.Bitmap.
+ ///
+ internal static System.Drawing.Bitmap arrowRight {
+ get {
+ object obj = ResourceManager.GetObject("arrowRight", resourceCulture);
+ return ((System.Drawing.Bitmap)(obj));
+ }
+ }
+
+ ///
+ /// Поиск локализованного ресурса типа System.Drawing.Bitmap.
+ ///
+ internal static System.Drawing.Bitmap arrowUp {
+ get {
+ object obj = ResourceManager.GetObject("arrowUp", resourceCulture);
+ return ((System.Drawing.Bitmap)(obj));
+ }
+ }
+ }
+}
diff --git a/ProjectAircraftCarrier_/ProjectAircraftCarrier_/Properties/Resources.resx b/ProjectAircraftCarrier_/ProjectAircraftCarrier_/Properties/Resources.resx
new file mode 100644
index 0000000..dc6b4c5
--- /dev/null
+++ b/ProjectAircraftCarrier_/ProjectAircraftCarrier_/Properties/Resources.resx
@@ -0,0 +1,133 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ text/microsoft-resx
+
+
+ 2.0
+
+
+ System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
+
+
+ System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
+
+
+
+ ..\Resources\arrowDown.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
+
+
+ ..\Resources\arrowLeft.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
+
+
+ ..\Resources\arrowRight.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
+
+
+ ..\Resources\arrowUp.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
+
+
\ No newline at end of file
diff --git a/ProjectAircraftCarrier_/ProjectAircraftCarrier_/Resources/arrowDown.png b/ProjectAircraftCarrier_/ProjectAircraftCarrier_/Resources/arrowDown.png
new file mode 100644
index 0000000..08436f4
Binary files /dev/null and b/ProjectAircraftCarrier_/ProjectAircraftCarrier_/Resources/arrowDown.png differ
diff --git a/ProjectAircraftCarrier_/ProjectAircraftCarrier_/Resources/arrowLeft.png b/ProjectAircraftCarrier_/ProjectAircraftCarrier_/Resources/arrowLeft.png
new file mode 100644
index 0000000..c8a7f4c
Binary files /dev/null and b/ProjectAircraftCarrier_/ProjectAircraftCarrier_/Resources/arrowLeft.png differ
diff --git a/ProjectAircraftCarrier_/ProjectAircraftCarrier_/Resources/arrowRight.png b/ProjectAircraftCarrier_/ProjectAircraftCarrier_/Resources/arrowRight.png
new file mode 100644
index 0000000..bd0fe69
Binary files /dev/null and b/ProjectAircraftCarrier_/ProjectAircraftCarrier_/Resources/arrowRight.png differ
diff --git a/ProjectAircraftCarrier_/ProjectAircraftCarrier_/Resources/arrowUp.png b/ProjectAircraftCarrier_/ProjectAircraftCarrier_/Resources/arrowUp.png
new file mode 100644
index 0000000..ac183c5
Binary files /dev/null and b/ProjectAircraftCarrier_/ProjectAircraftCarrier_/Resources/arrowUp.png differ