From 33525e179991246d4b1956d2df8e28b46652b5e1 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=D0=94=D0=B0=D0=BD=D0=B8=D1=8F=D1=80=20=D0=90=D0=B3=D0=BB?=
 =?UTF-8?q?=D0=B8=D1=83=D0=BB=D0=BB=D0=BE=D0=B2?= <danuar228@mail.ru>
Date: Thu, 29 Sep 2022 21:53:58 +0400
Subject: [PATCH 01/14] =?UTF-8?q?=D0=94=D0=BE=D0=B1=D0=B0=D0=B2=D0=BB?=
 =?UTF-8?q?=D0=B5=D0=BD=D0=B8=D0=B5=20=D1=8D=D0=BB=D0=B5=D0=BC=D0=B5=D0=BD?=
 =?UTF-8?q?=D1=82=D0=BE=D0=B2=20=D0=B8=D0=B7=20=D0=BF=D1=80=D0=BE=D0=B5?=
 =?UTF-8?q?=D0=BA=D1=82=D0=B0=20Cars?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

---
 AirBomber/AirBomber/Direction.cs              |   2 +-
 AirBomber/AirBomber/DrawningAirplane.cs       |   2 +-
 AirBomber/AirBomber/EntityAirplane.cs         |   2 +-
 AirBomber/AirBomber/FormAirBomber.Designer.cs |  14 ++
 AirBomber/AirBomber/FormAirBomber.cs          |  44 +++-
 .../FormMapWithSetAirplanes.Designer.cs       | 212 ++++++++++++++++++
 .../AirBomber/FormMapWithSetAirplanes.cs      | 150 +++++++++++++
 .../AirBomber/FormMapWithSetAirplanes.resx    |  60 +++++
 .../AirBomber/MapWithSetAirplanesGeneric.cs   | 170 ++++++++++++++
 AirBomber/AirBomber/Program.cs                |   2 +-
 AirBomber/AirBomber/SetAirplanesGeneric.cs    |  80 +++++++
 11 files changed, 728 insertions(+), 10 deletions(-)
 create mode 100644 AirBomber/AirBomber/FormMapWithSetAirplanes.Designer.cs
 create mode 100644 AirBomber/AirBomber/FormMapWithSetAirplanes.cs
 create mode 100644 AirBomber/AirBomber/FormMapWithSetAirplanes.resx
 create mode 100644 AirBomber/AirBomber/MapWithSetAirplanesGeneric.cs
 create mode 100644 AirBomber/AirBomber/SetAirplanesGeneric.cs

diff --git a/AirBomber/AirBomber/Direction.cs b/AirBomber/AirBomber/Direction.cs
index 808d3d0..a978408 100644
--- a/AirBomber/AirBomber/Direction.cs
+++ b/AirBomber/AirBomber/Direction.cs
@@ -3,7 +3,7 @@
     /// <summary>
     /// Направление перемещения
     /// </summary>
-    internal enum Direction
+    public enum Direction
     {
         None = 0,
         Up = 1,
diff --git a/AirBomber/AirBomber/DrawningAirplane.cs b/AirBomber/AirBomber/DrawningAirplane.cs
index c9cf1dc..08f7cce 100644
--- a/AirBomber/AirBomber/DrawningAirplane.cs
+++ b/AirBomber/AirBomber/DrawningAirplane.cs
@@ -3,7 +3,7 @@
     /// <summary>
     /// Класс, отвечающий за прорисовку и перемещение объекта-сущности
     /// </summary>
-    internal class DrawningAirplane
+    public class DrawningAirplane
     {
         /// <summary>
         /// Класс-сущность
diff --git a/AirBomber/AirBomber/EntityAirplane.cs b/AirBomber/AirBomber/EntityAirplane.cs
index 2869683..6ba8ec9 100644
--- a/AirBomber/AirBomber/EntityAirplane.cs
+++ b/AirBomber/AirBomber/EntityAirplane.cs
@@ -3,7 +3,7 @@
     /// <summary>
     /// Класс-сущность "Самолет"
     /// </summary>
-    internal class EntityAirplane
+    public class EntityAirplane
     {
         /// <summary>
         /// Скорость
diff --git a/AirBomber/AirBomber/FormAirBomber.Designer.cs b/AirBomber/AirBomber/FormAirBomber.Designer.cs
index 294d009..4e63c2f 100644
--- a/AirBomber/AirBomber/FormAirBomber.Designer.cs
+++ b/AirBomber/AirBomber/FormAirBomber.Designer.cs
@@ -39,6 +39,7 @@
             this.buttonRight = new System.Windows.Forms.Button();
             this.buttonDown = new System.Windows.Forms.Button();
             this.buttonCreateModif = new System.Windows.Forms.Button();
+            this.buttonSelectAirplane = new System.Windows.Forms.Button();
             ((System.ComponentModel.ISupportInitialize)(this.pictureBoxCar)).BeginInit();
             this.statusStrip.SuspendLayout();
             this.SuspendLayout();
@@ -153,11 +154,23 @@
             this.buttonCreateModif.UseVisualStyleBackColor = true;
             this.buttonCreateModif.Click += new System.EventHandler(this.buttonCreateModif_Click);
             // 
+            // buttonSelectAirplane
+            // 
+            this.buttonSelectAirplane.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
+            this.buttonSelectAirplane.Location = new System.Drawing.Point(577, 390);
+            this.buttonSelectAirplane.Name = "buttonSelectAirplane";
+            this.buttonSelectAirplane.Size = new System.Drawing.Size(75, 23);
+            this.buttonSelectAirplane.TabIndex = 8;
+            this.buttonSelectAirplane.Text = "Выбрать";
+            this.buttonSelectAirplane.UseVisualStyleBackColor = true;
+            this.buttonSelectAirplane.Click += new System.EventHandler(this.ButtonSelectCar_Click);
+            // 
             // FormAirBomber
             // 
             this.AutoScaleDimensions = new System.Drawing.SizeF(7F, 15F);
             this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
             this.ClientSize = new System.Drawing.Size(800, 450);
+            this.Controls.Add(this.buttonSelectAirplane);
             this.Controls.Add(this.buttonCreateModif);
             this.Controls.Add(this.buttonDown);
             this.Controls.Add(this.buttonRight);
@@ -189,5 +202,6 @@
         private Button buttonRight;
         private Button buttonDown;
         private Button buttonCreateModif;
+        private Button buttonSelectAirplane;
     }
 }
\ No newline at end of file
diff --git a/AirBomber/AirBomber/FormAirBomber.cs b/AirBomber/AirBomber/FormAirBomber.cs
index f177f21..f42628e 100644
--- a/AirBomber/AirBomber/FormAirBomber.cs
+++ b/AirBomber/AirBomber/FormAirBomber.cs
@@ -2,8 +2,13 @@ namespace AirBomber
 {
     public partial class FormAirBomber : Form
     {
-        private DrawningAirplane _airplane; 
-        
+        private DrawningAirplane _airplane;
+
+        /// <summary>
+        /// ��������� ������
+        /// </summary>
+        public DrawningAirplane SelectedAirplane { get; private set; }
+
         public FormAirBomber()
         {
             InitializeComponent();
@@ -37,7 +42,13 @@ namespace AirBomber
         private void ButtonCreate_Click(object sender, EventArgs e)
         {
             Random rnd = new();
-            _airplane = new DrawningAirplane(rnd.Next(100, 300), rnd.Next(1000, 2000), Color.FromArgb(rnd.Next(0, 256), rnd.Next(0, 256), rnd.Next(0, 256)));
+            Color color = Color.FromArgb(rnd.Next(0, 256), rnd.Next(0, 256), rnd.Next(0, 256));
+            ColorDialog dialog = new();
+            if (dialog.ShowDialog() == DialogResult.OK)
+            {
+                color = dialog.Color;
+            }
+            _airplane = new DrawningAirplane(rnd.Next(100, 300), rnd.Next(1000, 2000), color);
             SetData();
             Draw();
         }
@@ -85,12 +96,33 @@ namespace AirBomber
         private void buttonCreateModif_Click(object sender, EventArgs e)
         {
             Random rnd = new();
-            _airplane = new DrawningAirBomber(rnd.Next(100, 300), rnd.Next(1000, 2000),
-                Color.FromArgb(rnd.Next(0, 256), rnd.Next(0, 256), rnd.Next(0, 256)),
-                Color.FromArgb(rnd.Next(0, 256), rnd.Next(0, 256), rnd.Next(0, 256)),
+            Color color = Color.FromArgb(rnd.Next(0, 256), rnd.Next(0, 256), rnd.Next(0, 256));
+            ColorDialog dialog = new();
+            if (dialog.ShowDialog() == DialogResult.OK)
+            {
+                color = dialog.Color;
+            }
+            Color dopColor = Color.FromArgb(rnd.Next(0, 256), rnd.Next(0, 256), rnd.Next(0, 256));
+            ColorDialog dialogDop = new();
+            if (dialogDop.ShowDialog() == DialogResult.OK)
+            {
+                dopColor = dialogDop.Color;
+            }
+            _airplane = new DrawningAirBomber(rnd.Next(100, 300), rnd.Next(1000, 2000), color, dopColor,
                 Convert.ToBoolean(rnd.Next(0, 2)), Convert.ToBoolean(rnd.Next(0, 2)));
             SetData();
             Draw();
         }
+
+        /// <summary>
+        /// ��������� ������� ������ "�������"
+        /// </summary>
+        /// <param name="sender"></param>
+        /// <param name="e"></param>
+        private void ButtonSelectCar_Click(object sender, EventArgs e)
+        {
+            SelectedAirplane = _airplane;
+            DialogResult = DialogResult.OK;
+        }
     }
 }
\ No newline at end of file
diff --git a/AirBomber/AirBomber/FormMapWithSetAirplanes.Designer.cs b/AirBomber/AirBomber/FormMapWithSetAirplanes.Designer.cs
new file mode 100644
index 0000000..86f17b8
--- /dev/null
+++ b/AirBomber/AirBomber/FormMapWithSetAirplanes.Designer.cs
@@ -0,0 +1,212 @@
+namespace AirBomber
+{
+    partial class FormMapWithSetAirplanes
+    {
+        /// <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.groupBoxTools = new System.Windows.Forms.GroupBox();
+            this.maskedTextBoxPosition = new System.Windows.Forms.MaskedTextBox();
+            this.buttonRemoveAirplane = new System.Windows.Forms.Button();
+            this.buttonShowStorage = new System.Windows.Forms.Button();
+            this.buttonDown = new System.Windows.Forms.Button();
+            this.buttonRight = new System.Windows.Forms.Button();
+            this.buttonLeft = new System.Windows.Forms.Button();
+            this.buttonUp = new System.Windows.Forms.Button();
+            this.buttonShowOnMap = new System.Windows.Forms.Button();
+            this.buttonAddAirplane = new System.Windows.Forms.Button();
+            this.comboBoxSelectorMap = new System.Windows.Forms.ComboBox();
+            this.pictureBox = new System.Windows.Forms.PictureBox();
+            this.groupBoxTools.SuspendLayout();
+            ((System.ComponentModel.ISupportInitialize)(this.pictureBox)).BeginInit();
+            this.SuspendLayout();
+            // 
+            // groupBoxTools
+            // 
+            this.groupBoxTools.Controls.Add(this.maskedTextBoxPosition);
+            this.groupBoxTools.Controls.Add(this.buttonRemoveAirplane);
+            this.groupBoxTools.Controls.Add(this.buttonShowStorage);
+            this.groupBoxTools.Controls.Add(this.buttonDown);
+            this.groupBoxTools.Controls.Add(this.buttonRight);
+            this.groupBoxTools.Controls.Add(this.buttonLeft);
+            this.groupBoxTools.Controls.Add(this.buttonUp);
+            this.groupBoxTools.Controls.Add(this.buttonShowOnMap);
+            this.groupBoxTools.Controls.Add(this.buttonAddAirplane);
+            this.groupBoxTools.Controls.Add(this.comboBoxSelectorMap);
+            this.groupBoxTools.Dock = System.Windows.Forms.DockStyle.Right;
+            this.groupBoxTools.Location = new System.Drawing.Point(811, 0);
+            this.groupBoxTools.Name = "groupBoxTools";
+            this.groupBoxTools.Size = new System.Drawing.Size(204, 554);
+            this.groupBoxTools.TabIndex = 0;
+            this.groupBoxTools.TabStop = false;
+            this.groupBoxTools.Text = "Инструменты";
+            // 
+            // maskedTextBoxPosition
+            // 
+            this.maskedTextBoxPosition.Location = new System.Drawing.Point(17, 166);
+            this.maskedTextBoxPosition.Mask = "00";
+            this.maskedTextBoxPosition.Name = "maskedTextBoxPosition";
+            this.maskedTextBoxPosition.Size = new System.Drawing.Size(175, 23);
+            this.maskedTextBoxPosition.TabIndex = 2;
+            this.maskedTextBoxPosition.ValidatingType = typeof(int);
+            // 
+            // buttonRemoveAirplane
+            // 
+            this.buttonRemoveAirplane.Location = new System.Drawing.Point(17, 195);
+            this.buttonRemoveAirplane.Name = "buttonRemoveAirplane";
+            this.buttonRemoveAirplane.Size = new System.Drawing.Size(175, 35);
+            this.buttonRemoveAirplane.TabIndex = 3;
+            this.buttonRemoveAirplane.Text = "Удалить самолет";
+            this.buttonRemoveAirplane.UseVisualStyleBackColor = true;
+            this.buttonRemoveAirplane.Click += new System.EventHandler(this.ButtonRemoveCar_Click);
+            // 
+            // buttonShowStorage
+            // 
+            this.buttonShowStorage.Location = new System.Drawing.Point(17, 287);
+            this.buttonShowStorage.Name = "buttonShowStorage";
+            this.buttonShowStorage.Size = new System.Drawing.Size(175, 35);
+            this.buttonShowStorage.TabIndex = 4;
+            this.buttonShowStorage.Text = "Посмотреть хранилище";
+            this.buttonShowStorage.UseVisualStyleBackColor = true;
+            this.buttonShowStorage.Click += new System.EventHandler(this.ButtonShowStorage_Click);
+            // 
+            // buttonDown
+            // 
+            this.buttonDown.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
+            this.buttonDown.BackgroundImage = global::AirBomber.Properties.Resources.arrowDown;
+            this.buttonDown.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Stretch;
+            this.buttonDown.Location = new System.Drawing.Point(91, 504);
+            this.buttonDown.Name = "buttonDown";
+            this.buttonDown.Size = new System.Drawing.Size(30, 30);
+            this.buttonDown.TabIndex = 10;
+            this.buttonDown.UseVisualStyleBackColor = true;
+            // 
+            // buttonRight
+            // 
+            this.buttonRight.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
+            this.buttonRight.BackgroundImage = global::AirBomber.Properties.Resources.arrowRight;
+            this.buttonRight.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Stretch;
+            this.buttonRight.Location = new System.Drawing.Point(127, 504);
+            this.buttonRight.Name = "buttonRight";
+            this.buttonRight.Size = new System.Drawing.Size(30, 30);
+            this.buttonRight.TabIndex = 9;
+            this.buttonRight.UseVisualStyleBackColor = true;
+            // 
+            // buttonLeft
+            // 
+            this.buttonLeft.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
+            this.buttonLeft.BackgroundImage = global::AirBomber.Properties.Resources.arrowLeft;
+            this.buttonLeft.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Stretch;
+            this.buttonLeft.Location = new System.Drawing.Point(55, 504);
+            this.buttonLeft.Name = "buttonLeft";
+            this.buttonLeft.Size = new System.Drawing.Size(30, 30);
+            this.buttonLeft.TabIndex = 8;
+            this.buttonLeft.UseVisualStyleBackColor = true;
+            // 
+            // buttonUp
+            // 
+            this.buttonUp.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
+            this.buttonUp.BackgroundImage = global::AirBomber.Properties.Resources.arrowUp;
+            this.buttonUp.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Stretch;
+            this.buttonUp.Location = new System.Drawing.Point(91, 468);
+            this.buttonUp.Name = "buttonUp";
+            this.buttonUp.Size = new System.Drawing.Size(30, 30);
+            this.buttonUp.TabIndex = 7;
+            this.buttonUp.UseVisualStyleBackColor = true;
+            // 
+            // buttonShowOnMap
+            // 
+            this.buttonShowOnMap.Location = new System.Drawing.Point(17, 391);
+            this.buttonShowOnMap.Name = "buttonShowOnMap";
+            this.buttonShowOnMap.Size = new System.Drawing.Size(175, 35);
+            this.buttonShowOnMap.TabIndex = 5;
+            this.buttonShowOnMap.Text = "Посмотреть карту";
+            this.buttonShowOnMap.UseVisualStyleBackColor = true;
+            this.buttonShowOnMap.Click += new System.EventHandler(this.ButtonShowOnMap_Click);
+            // 
+            // buttonAddAirplane
+            // 
+            this.buttonAddAirplane.Location = new System.Drawing.Point(17, 106);
+            this.buttonAddAirplane.Name = "buttonAddAirplane";
+            this.buttonAddAirplane.Size = new System.Drawing.Size(175, 35);
+            this.buttonAddAirplane.TabIndex = 1;
+            this.buttonAddAirplane.Text = "Добавить самолет";
+            this.buttonAddAirplane.UseVisualStyleBackColor = true;
+            this.buttonAddAirplane.Click += new System.EventHandler(this.ButtonAddCar_Click);
+            // 
+            // comboBoxSelectorMap
+            // 
+            this.comboBoxSelectorMap.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
+            this.comboBoxSelectorMap.FormattingEnabled = true;
+            this.comboBoxSelectorMap.Items.AddRange(new object[] {
+            "Простая карта"});
+            this.comboBoxSelectorMap.Location = new System.Drawing.Point(17, 32);
+            this.comboBoxSelectorMap.Name = "comboBoxSelectorMap";
+            this.comboBoxSelectorMap.Size = new System.Drawing.Size(175, 23);
+            this.comboBoxSelectorMap.TabIndex = 0;
+            this.comboBoxSelectorMap.SelectedIndexChanged += new System.EventHandler(this.ComboBoxSelectorMap_SelectedIndexChanged);
+            // 
+            // pictureBox
+            // 
+            this.pictureBox.Dock = System.Windows.Forms.DockStyle.Fill;
+            this.pictureBox.Location = new System.Drawing.Point(0, 0);
+            this.pictureBox.Name = "pictureBox";
+            this.pictureBox.Size = new System.Drawing.Size(811, 554);
+            this.pictureBox.TabIndex = 1;
+            this.pictureBox.TabStop = false;
+            // 
+            // FormMapWithSetCars
+            // 
+            this.AutoScaleDimensions = new System.Drawing.SizeF(7F, 15F);
+            this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
+            this.ClientSize = new System.Drawing.Size(1015, 554);
+            this.Controls.Add(this.pictureBox);
+            this.Controls.Add(this.groupBoxTools);
+            this.Name = "FormMapWithSetCars";
+            this.Text = "Карта с набором объектов";
+            this.groupBoxTools.ResumeLayout(false);
+            this.groupBoxTools.PerformLayout();
+            ((System.ComponentModel.ISupportInitialize)(this.pictureBox)).EndInit();
+            this.ResumeLayout(false);
+
+        }
+
+        #endregion
+
+        private GroupBox groupBoxTools;
+        private PictureBox pictureBox;
+        private ComboBox comboBoxSelectorMap;
+        private Button buttonShowOnMap;
+        private Button buttonAddAirplane;
+        private Button buttonDown;
+        private Button buttonRight;
+        private Button buttonLeft;
+        private Button buttonUp;
+        private Button buttonShowStorage;
+        private Button buttonRemoveAirplane;
+        private MaskedTextBox maskedTextBoxPosition;
+    }
+}
\ No newline at end of file
diff --git a/AirBomber/AirBomber/FormMapWithSetAirplanes.cs b/AirBomber/AirBomber/FormMapWithSetAirplanes.cs
new file mode 100644
index 0000000..1adaa30
--- /dev/null
+++ b/AirBomber/AirBomber/FormMapWithSetAirplanes.cs
@@ -0,0 +1,150 @@
+namespace AirBomber
+{
+    public partial class FormMapWithSetAirplanes : Form
+    {
+        /// <summary>
+        /// Объект от класса карты с набором объектов
+        /// </summary>
+        private MapWithSetAirplanesGeneric<DrawningObject, AbstractMap> _mapAirplanesCollectionGeneric;
+        /// <summary>
+        /// Конструктор
+        /// </summary>
+        public FormMapWithSetAirplanes()
+        {
+            InitializeComponent();
+        }
+        /// <summary>
+        /// Выбор карты
+        /// </summary>
+        /// <param name="sender"></param>
+        /// <param name="e"></param>
+        private void ComboBoxSelectorMap_SelectedIndexChanged(object sender, EventArgs e)
+        {
+            AbstractMap map = null;
+            switch (comboBoxSelectorMap.Text)
+            {
+                case "Простая карта":
+                    map = new SimpleMap();
+                    break;
+            }
+            if (map != null)
+            {
+                _mapAirplanesCollectionGeneric = new MapWithSetAirplanesGeneric<DrawningObject, AbstractMap>(
+                    pictureBox.Width, pictureBox.Height, map);
+            }
+            else
+            {
+                _mapAirplanesCollectionGeneric = null;
+            }
+        }
+        /// <summary>
+        /// Добавление объекта
+        /// </summary>
+        /// <param name="sender"></param>
+        /// <param name="e"></param>
+        private void ButtonAddCar_Click(object sender, EventArgs e)
+        {
+            if(_mapAirplanesCollectionGeneric == null)
+            {
+                return;
+            }
+            FormAirBomber form = new();
+            if (form.ShowDialog() == DialogResult.OK)
+            {
+                DrawningObject car = new(form.SelectedAirplane);
+                if (_mapAirplanesCollectionGeneric + car)
+                {
+                    MessageBox.Show("Объект добавлен");
+                    pictureBox.Image = _mapAirplanesCollectionGeneric.ShowSet();
+                }
+                else
+                {
+                    MessageBox.Show("Не удалось добавить объект");
+                }
+            }
+        }
+        /// <summary>
+        /// Удаление объекта
+        /// </summary>
+        /// <param name="sender"></param>
+        /// <param name="e"></param>
+        private void ButtonRemoveCar_Click(object sender, EventArgs e)
+        {
+            if (string.IsNullOrEmpty(maskedTextBoxPosition.Text))
+            {
+                return;
+            }
+            if (MessageBox.Show("Удалить объект?", "Удаление", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.No)
+            {
+                return;
+            }
+            int pos = Convert.ToInt32(maskedTextBoxPosition.Text);
+            if (_mapAirplanesCollectionGeneric - pos)
+            {
+                MessageBox.Show("Объект удален");
+                pictureBox.Image = _mapAirplanesCollectionGeneric.ShowSet();
+            }
+            else
+            {
+                MessageBox.Show("Не удалось удалить объект");
+            }
+        }
+        /// <summary>
+        /// Вывод набора
+        /// </summary>
+        /// <param name="sender"></param>
+        /// <param name="e"></param>
+        private void ButtonShowStorage_Click(object sender, EventArgs e)
+        {
+            if (_mapAirplanesCollectionGeneric == null)
+            {
+                return;
+            }
+            pictureBox.Image = _mapAirplanesCollectionGeneric.ShowSet();
+        }
+        /// <summary>
+        /// Вывод карты
+        /// </summary>
+        /// <param name="sender"></param>
+        /// <param name="e"></param>
+        private void ButtonShowOnMap_Click(object sender, EventArgs e)
+        {
+            if (_mapAirplanesCollectionGeneric == null)
+            {
+                return;
+            }
+            pictureBox.Image = _mapAirplanesCollectionGeneric.ShowOnMap();
+        }
+        /// <summary>
+        /// Перемещение
+        /// </summary>
+        /// <param name="sender"></param>
+        /// <param name="e"></param>
+        private void ButtonMove_Click(object sender, EventArgs e)
+        {
+            if (_mapAirplanesCollectionGeneric == null)
+            {
+                return;
+            }
+            //получаем имя кнопки
+            string name = ((Button)sender)?.Name ?? string.Empty;
+            Direction dir = Direction.None;
+            switch (name)
+            {
+                case "buttonUp":
+                    dir = Direction.Up;
+                    break;
+                case "buttonDown":
+                    dir = Direction.Down;
+                    break;
+                case "buttonLeft":
+                    dir = Direction.Left;
+                    break;
+                case "buttonRight":
+                    dir = Direction.Right;
+                    break;
+            }
+            pictureBox.Image = _mapAirplanesCollectionGeneric.MoveObject(dir);
+        }
+    }
+}
\ No newline at end of file
diff --git a/AirBomber/AirBomber/FormMapWithSetAirplanes.resx b/AirBomber/AirBomber/FormMapWithSetAirplanes.resx
new file mode 100644
index 0000000..f298a7b
--- /dev/null
+++ b/AirBomber/AirBomber/FormMapWithSetAirplanes.resx
@@ -0,0 +1,60 @@
+<root>
+  <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>
+</root>
\ No newline at end of file
diff --git a/AirBomber/AirBomber/MapWithSetAirplanesGeneric.cs b/AirBomber/AirBomber/MapWithSetAirplanesGeneric.cs
new file mode 100644
index 0000000..e54e7a8
--- /dev/null
+++ b/AirBomber/AirBomber/MapWithSetAirplanesGeneric.cs
@@ -0,0 +1,170 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace AirBomber
+{
+    internal class MapWithSetAirplanesGeneric<T, U>
+        where T : class, IDrawningObject
+        where U : AbstractMap
+    {
+        /// <summary>
+        /// Ширина окна отрисовки
+        /// </summary>
+        private readonly int _pictureWidth;
+        /// <summary>
+        /// Высота окна отрисовки
+        /// </summary>
+        private readonly int _pictureHeight;
+        /// <summary>
+        /// Размер занимаемого объектом места (ширина)
+        /// </summary>
+        private readonly int _placeSizeWidth = 210;
+        /// <summary>
+        /// Размер занимаемого объектом места (высота)
+        /// </summary>
+        private readonly int _placeSizeHeight = 90;
+        /// <summary>
+        /// Набор объектов
+        /// </summary>
+        private readonly SetAirplanesGeneric<T> _setAirplanes;
+        /// <summary>
+        /// Карта
+        /// </summary>
+        private readonly U _map;
+        /// <summary>
+        /// Конструктор
+        /// </summary>
+        /// <param name="picWidth"></param>
+        /// <param name="picHeight"></param>
+        /// <param name="map"></param>
+        public MapWithSetAirplanesGeneric(int picWidth, int picHeight, U map)
+        {
+            int width = picWidth / _placeSizeWidth;
+            int height = picHeight / _placeSizeHeight;
+            _setAirplanes = new SetAirplanesGeneric<T>(width * height);
+            _pictureWidth = picWidth;
+            _pictureHeight = picHeight;
+            _map = map;
+        }
+        /// <summary>
+        /// Перегрузка оператора сложения
+        /// </summary>
+        /// <param name="map"></param>
+        /// <param name="airplane"></param>
+        /// <returns></returns>
+        public static bool operator +(MapWithSetAirplanesGeneric<T, U> map, T airplane)
+        {
+            return map._setAirplanes.Insert(airplane);
+        }
+        /// <summary>
+        /// Перегрузка оператора вычитания
+        /// </summary>
+        /// <param name="map"></param>
+        /// <param name="position"></param>
+        /// <returns></returns>
+        public static bool operator -(MapWithSetAirplanesGeneric<T, U> map, int position)
+        {
+            return map._setAirplanes.Remove(position);
+        }
+        /// <summary>
+        /// Вывод всего набора объектов
+        /// </summary>
+        /// <returns></returns>
+        public Bitmap ShowSet()
+        {
+            Bitmap bmp = new(_pictureWidth, _pictureHeight);
+            Graphics gr = Graphics.FromImage(bmp);
+            DrawBackground(gr);
+            Drawairplanes(gr);
+            return bmp;
+        }
+        /// <summary>
+        /// Просмотр объекта на карте
+        /// </summary>
+        /// <returns></returns>
+        public Bitmap ShowOnMap()
+        {
+            Shaking();
+            for (int i = 0; i < _setAirplanes.Count; i++)
+            {
+                var airplane = _setAirplanes.Get(i);
+                if (airplane != null)
+                {
+                    return _map.CreateMap(_pictureWidth, _pictureHeight, airplane);
+                }
+            }
+            return new(_pictureWidth, _pictureHeight);
+        }
+        /// <summary>
+        /// Перемещение объекта по крате
+        /// </summary>
+        /// <param name="direction"></param>
+        /// <returns></returns>
+        public Bitmap MoveObject(Direction direction)
+        {
+            if (_map != null)
+            {
+                return _map.MoveObject(direction);
+            }
+            return new(_pictureWidth, _pictureHeight);
+        }
+        /// <summary>
+        /// "Взбалтываем" набор, чтобы все элементы оказались в начале
+        /// </summary>
+        private void Shaking()
+        {
+            int j = _setAirplanes.Count - 1;
+            for (int i = 0; i < _setAirplanes.Count; i++)
+            {
+                if (_setAirplanes.Get(i) == null)
+                {
+                    for (; j > i; j--)
+                    {
+                        var airplane = _setAirplanes.Get(j);
+                        if (airplane != null)
+                        {
+                            _setAirplanes.Insert(airplane, i);
+                            _setAirplanes.Remove(j);
+                            break;
+                        }
+                    }
+                    if (j <= i)
+                    {
+                        return;
+                    }
+                }
+            }
+        }
+        /// <summary>
+        /// Метод отрисовки фона
+        /// </summary>
+        /// <param name="g"></param>
+        private void DrawBackground(Graphics g)
+        {
+            Pen pen = new(Color.Black, 3);
+            for (int i = 0; i < _pictureWidth / _placeSizeWidth; i++)
+            {
+                for (int j = 0; j < _pictureHeight / _placeSizeHeight + 1; ++j)
+                {//линия рамзетки места
+                    g.DrawLine(pen, i * _placeSizeWidth, j * _placeSizeHeight, i * _placeSizeWidth + _placeSizeWidth / 2, j * _placeSizeHeight);
+                }
+                g.DrawLine(pen, i * _placeSizeWidth, 0, i * _placeSizeWidth, (_pictureHeight / _placeSizeHeight) * _placeSizeHeight);
+            }
+        }
+        /// <summary>
+        /// Метод прорисовки объектов
+        /// </summary>
+        /// <param name="g"></param>
+        private void Drawairplanes(Graphics g)
+        {
+            for (int i = 0; i < _setAirplanes.Count; i++)
+            {
+                // TODO установка позиции
+                _setAirplanes.Get(i)?.DrawningObject(g);
+            }
+        }
+    }
+}
diff --git a/AirBomber/AirBomber/Program.cs b/AirBomber/AirBomber/Program.cs
index e462fb5..5325330 100644
--- a/AirBomber/AirBomber/Program.cs
+++ b/AirBomber/AirBomber/Program.cs
@@ -11,7 +11,7 @@ namespace AirBomber
             // To customize application configuration such as set high DPI settings or default font,
             // see https://aka.ms/applicationconfiguration.
             ApplicationConfiguration.Initialize();
-            Application.Run(new FormMap());
+            Application.Run(new FormMapWithSetAirplanes());
         }
     }
 }
\ No newline at end of file
diff --git a/AirBomber/AirBomber/SetAirplanesGeneric.cs b/AirBomber/AirBomber/SetAirplanesGeneric.cs
new file mode 100644
index 0000000..ab32adf
--- /dev/null
+++ b/AirBomber/AirBomber/SetAirplanesGeneric.cs
@@ -0,0 +1,80 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace AirBomber
+{
+    /// <summary>
+    /// Параметризованный набор объектов
+    /// </summary>
+    /// <typeparam name="T"></typeparam>
+    internal class SetAirplanesGeneric<T>
+        where T : class
+    {
+        /// <summary>
+        /// Массив объектов, которые храним
+        /// </summary>
+        private readonly T[] _places;
+        /// <summary>
+        /// Количество объектов в массиве
+        /// </summary>
+        public int Count => _places.Length;
+        /// <summary>
+        /// Конструктор
+        /// </summary>
+        /// <param name="count"></param>
+        public SetAirplanesGeneric(int count)
+        {
+            _places = new T[count];
+        }
+        /// <summary>
+        /// Добавление объекта в набор
+        /// </summary>
+        /// <param name="airplane">Добавляемый самолет</param>
+        /// <returns></returns>
+        public bool Insert(T airplane)
+        {
+            // TODO вставка в начало набора
+            return true;
+        }
+        /// <summary>
+        /// Добавление объекта в набор на конкретную позицию
+        /// </summary>
+        /// <param name="airplane">Добавляемый самолет</param>
+        /// <param name="position">Позиция</param>
+        /// <returns></returns>
+        public bool Insert(T airplane, int position)
+        {
+            // TODO проверка позиции
+            // TODO проверка, что элемент массива по этой позиции пустой, если нет, то
+            //		проверка, что после вставляемого элемента в массиве есть пустой элемент
+            //		сдвиг всех объектов, находящихся справа от позиции до первого пустого элемента
+            // TODO вставка по позиции
+            _places[position] = airplane;
+            return true;
+        }
+        /// <summary>
+        /// Удаление объекта из набора с конкретной позиции
+        /// </summary>
+        /// <param name="position"></param>
+        /// <returns></returns>
+        public bool Remove(int position)
+        {
+            // TODO проверка позиции
+            // TODO удаление объекта из массива, присовив элементу массива значение null
+            return true;
+        }
+        /// <summary>
+        /// Получение объекта из набора по позиции
+        /// </summary>
+        /// <param name="position"></param>
+        /// <returns></returns>
+        public T Get(int position)
+        {
+            // TODO проверка позиции
+            return _places[position];
+        }
+    }
+}
-- 
2.25.1


From 9d1f86bdd02df1f95b0b3cb85beefcf58f17ea41 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=D0=94=D0=B0=D0=BD=D0=B8=D1=8F=D1=80=20=D0=90=D0=B3=D0=BB?=
 =?UTF-8?q?=D0=B8=D1=83=D0=BB=D0=BB=D0=BE=D0=B2?= <danuar228@mail.ru>
Date: Thu, 29 Sep 2022 21:55:54 +0400
Subject: [PATCH 02/14] =?UTF-8?q?=D0=97=D0=B0=D0=BC=D0=B5=D0=BD=D0=B0=20?=
 =?UTF-8?q?=D0=B0=D0=B2=D1=82=D0=BE=D0=BC=D0=BE=D0=B1=D0=B8=D0=BB=D1=8F=20?=
 =?UTF-8?q?=D0=BD=D0=B0=20=D1=81=D0=B0=D0=BC=D0=BE=D0=BB=D0=B5=D1=82?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

---
 AirBomber/AirBomber/FormAirBomber.Designer.cs | 26 +++++++++----------
 AirBomber/AirBomber/FormAirBomber.cs          | 10 +++----
 2 files changed, 18 insertions(+), 18 deletions(-)

diff --git a/AirBomber/AirBomber/FormAirBomber.Designer.cs b/AirBomber/AirBomber/FormAirBomber.Designer.cs
index 4e63c2f..8bd2d15 100644
--- a/AirBomber/AirBomber/FormAirBomber.Designer.cs
+++ b/AirBomber/AirBomber/FormAirBomber.Designer.cs
@@ -28,7 +28,7 @@
         /// </summary>
         private void InitializeComponent()
         {
-            this.pictureBoxCar = new System.Windows.Forms.PictureBox();
+            this.pictureBoxAirplane = new System.Windows.Forms.PictureBox();
             this.statusStrip = new System.Windows.Forms.StatusStrip();
             this.toolStripStatusLabelSpeed = new System.Windows.Forms.ToolStripStatusLabel();
             this.toolStripStatusLabelWeight = new System.Windows.Forms.ToolStripStatusLabel();
@@ -44,16 +44,16 @@
             this.statusStrip.SuspendLayout();
             this.SuspendLayout();
             // 
-            // pictureBoxCar
+            // pictureBoxAirplane
             // 
-            this.pictureBoxCar.Dock = System.Windows.Forms.DockStyle.Fill;
-            this.pictureBoxCar.Location = new System.Drawing.Point(0, 0);
-            this.pictureBoxCar.Name = "pictureBoxCar";
-            this.pictureBoxCar.Size = new System.Drawing.Size(800, 428);
-            this.pictureBoxCar.SizeMode = System.Windows.Forms.PictureBoxSizeMode.AutoSize;
-            this.pictureBoxCar.TabIndex = 0;
-            this.pictureBoxCar.TabStop = false;
-            this.pictureBoxCar.Resize += new System.EventHandler(this.PictureBoxCar_Resize);
+            this.pictureBoxAirplane.Dock = System.Windows.Forms.DockStyle.Fill;
+            this.pictureBoxAirplane.Location = new System.Drawing.Point(0, 0);
+            this.pictureBoxAirplane.Name = "pictureBoxAirplane";
+            this.pictureBoxAirplane.Size = new System.Drawing.Size(800, 428);
+            this.pictureBoxAirplane.SizeMode = System.Windows.Forms.PictureBoxSizeMode.AutoSize;
+            this.pictureBoxAirplane.TabIndex = 0;
+            this.pictureBoxAirplane.TabStop = false;
+            this.pictureBoxAirplane.Resize += new System.EventHandler(this.PictureBoxAirplane_Resize);
             // 
             // statusStrip
             // 
@@ -177,11 +177,11 @@
             this.Controls.Add(this.buttonLeft);
             this.Controls.Add(this.buttonUp);
             this.Controls.Add(this.buttonCreate);
-            this.Controls.Add(this.pictureBoxCar);
+            this.Controls.Add(this.pictureBoxAirplane);
             this.Controls.Add(this.statusStrip);
             this.Name = "FormAirBomber";
             this.Text = "Самолет";
-            ((System.ComponentModel.ISupportInitialize)(this.pictureBoxCar)).EndInit();
+            ((System.ComponentModel.ISupportInitialize)(this.pictureBoxAirplane)).EndInit();
             this.statusStrip.ResumeLayout(false);
             this.statusStrip.PerformLayout();
             this.ResumeLayout(false);
@@ -191,7 +191,7 @@
 
         #endregion
 
-        private PictureBox pictureBoxCar;
+        private PictureBox pictureBoxAirplane;
         private StatusStrip statusStrip;
         private ToolStripStatusLabel toolStripStatusLabelSpeed;
         private ToolStripStatusLabel toolStripStatusLabelWeight;
diff --git a/AirBomber/AirBomber/FormAirBomber.cs b/AirBomber/AirBomber/FormAirBomber.cs
index f42628e..ec360b8 100644
--- a/AirBomber/AirBomber/FormAirBomber.cs
+++ b/AirBomber/AirBomber/FormAirBomber.cs
@@ -14,14 +14,14 @@ namespace AirBomber
             InitializeComponent();
         }
         /// <summary>
-        /// ����� ���������� ������
+        /// ����� ���������� ��������
         /// </summary>
 		private void Draw()
         {
-            Bitmap bmp = new(pictureBoxCar.Width, pictureBoxCar.Height);
+            Bitmap bmp = new(pictureBoxAirplane.Width, pictureBoxAirplane.Height);
             Graphics gr = Graphics.FromImage(bmp);
             _airplane?.DrawTransport(gr);
-            pictureBoxCar.Image = bmp;
+            pictureBoxAirplane.Image = bmp;
         }
         /// <summary>
         /// ����� ��������� ������
@@ -83,9 +83,9 @@ namespace AirBomber
         /// </summary>
         /// <param name="sender"></param>
         /// <param name="e"></param>
-        private void PictureBoxCar_Resize(object sender, EventArgs e)
+        private void PictureBoxAirplane_Resize(object sender, EventArgs e)
         {
-            _airplane?.ChangeBorders(pictureBoxCar.Width, pictureBoxCar.Height);
+            _airplane?.ChangeBorders(pictureBoxAirplane.Width, pictureBoxAirplane.Height);
             Draw();
         }
         /// <summary>
-- 
2.25.1


From 56c05a4d82e40b2a66ee257e030992e4ca1ef744 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=D0=94=D0=B0=D0=BD=D0=B8=D1=8F=D1=80=20=D0=90=D0=B3=D0=BB?=
 =?UTF-8?q?=D0=B8=D1=83=D0=BB=D0=BB=D0=BE=D0=B2?= <danuar228@mail.ru>
Date: Thu, 29 Sep 2022 22:15:20 +0400
Subject: [PATCH 03/14] =?UTF-8?q?=D0=97=D0=B0=D0=BC=D0=B5=D0=BD=D0=B5?=
 =?UTF-8?q?=D0=BD=D1=8B=20=D0=B0=D0=B2=D1=82=D0=BE=D0=BC=D0=BE=D0=B1=D0=B8?=
 =?UTF-8?q?=D0=BB=D0=B8=20=D0=B8=20=D1=83=D0=B4=D0=B0=D0=BB=D0=B5=D0=BD=20?=
 =?UTF-8?q?FormMap?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

---
 AirBomber/AirBomber/FormAirBomber.Designer.cs |   4 +-
 AirBomber/AirBomber/FormMap.Designer.cs       | 208 ------------------
 AirBomber/AirBomber/FormMap.cs                |  96 --------
 AirBomber/AirBomber/FormMap.resx              |  63 ------
 .../FormMapWithSetAirplanes.Designer.cs       |   8 +-
 .../AirBomber/FormMapWithSetAirplanes.cs      |   8 +-
 6 files changed, 10 insertions(+), 377 deletions(-)
 delete mode 100644 AirBomber/AirBomber/FormMap.Designer.cs
 delete mode 100644 AirBomber/AirBomber/FormMap.cs
 delete mode 100644 AirBomber/AirBomber/FormMap.resx

diff --git a/AirBomber/AirBomber/FormAirBomber.Designer.cs b/AirBomber/AirBomber/FormAirBomber.Designer.cs
index 8bd2d15..9f107c8 100644
--- a/AirBomber/AirBomber/FormAirBomber.Designer.cs
+++ b/AirBomber/AirBomber/FormAirBomber.Designer.cs
@@ -40,7 +40,7 @@
             this.buttonDown = new System.Windows.Forms.Button();
             this.buttonCreateModif = new System.Windows.Forms.Button();
             this.buttonSelectAirplane = new System.Windows.Forms.Button();
-            ((System.ComponentModel.ISupportInitialize)(this.pictureBoxCar)).BeginInit();
+            ((System.ComponentModel.ISupportInitialize)(this.pictureBoxAirplane)).BeginInit();
             this.statusStrip.SuspendLayout();
             this.SuspendLayout();
             // 
@@ -163,7 +163,7 @@
             this.buttonSelectAirplane.TabIndex = 8;
             this.buttonSelectAirplane.Text = "Выбрать";
             this.buttonSelectAirplane.UseVisualStyleBackColor = true;
-            this.buttonSelectAirplane.Click += new System.EventHandler(this.ButtonSelectCar_Click);
+            this.buttonSelectAirplane.Click += new System.EventHandler(this.ButtonSelectAirplane_Click);
             // 
             // FormAirBomber
             // 
diff --git a/AirBomber/AirBomber/FormMap.Designer.cs b/AirBomber/AirBomber/FormMap.Designer.cs
deleted file mode 100644
index 54ebe8b..0000000
--- a/AirBomber/AirBomber/FormMap.Designer.cs
+++ /dev/null
@@ -1,208 +0,0 @@
-namespace AirBomber
-{
-    partial class FormMap
-    {
-        /// <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.pictureBoxCar = new System.Windows.Forms.PictureBox();
-            this.statusStrip = new System.Windows.Forms.StatusStrip();
-            this.toolStripStatusLabelSpeed = new System.Windows.Forms.ToolStripStatusLabel();
-            this.toolStripStatusLabelWeight = new System.Windows.Forms.ToolStripStatusLabel();
-            this.toolStripStatusLabelBodyColor = new System.Windows.Forms.ToolStripStatusLabel();
-            this.buttonCreate = new System.Windows.Forms.Button();
-            this.buttonUp = new System.Windows.Forms.Button();
-            this.buttonLeft = new System.Windows.Forms.Button();
-            this.buttonRight = new System.Windows.Forms.Button();
-            this.buttonDown = new System.Windows.Forms.Button();
-            this.buttonCreateModif = new System.Windows.Forms.Button();
-            this.comboBoxSelectorMap = new System.Windows.Forms.ComboBox();
-            ((System.ComponentModel.ISupportInitialize)(this.pictureBoxCar)).BeginInit();
-            this.statusStrip.SuspendLayout();
-            this.SuspendLayout();
-            // 
-            // pictureBoxCar
-            // 
-            this.pictureBoxCar.Dock = System.Windows.Forms.DockStyle.Fill;
-            this.pictureBoxCar.Location = new System.Drawing.Point(0, 0);
-            this.pictureBoxCar.Name = "pictureBoxCar";
-            this.pictureBoxCar.Size = new System.Drawing.Size(800, 428);
-            this.pictureBoxCar.SizeMode = System.Windows.Forms.PictureBoxSizeMode.AutoSize;
-            this.pictureBoxCar.TabIndex = 0;
-            this.pictureBoxCar.TabStop = false;
-            // 
-            // statusStrip
-            // 
-            this.statusStrip.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
-            this.toolStripStatusLabelSpeed,
-            this.toolStripStatusLabelWeight,
-            this.toolStripStatusLabelBodyColor});
-            this.statusStrip.Location = new System.Drawing.Point(0, 428);
-            this.statusStrip.Name = "statusStrip";
-            this.statusStrip.Size = new System.Drawing.Size(800, 22);
-            this.statusStrip.TabIndex = 1;
-            // 
-            // toolStripStatusLabelSpeed
-            // 
-            this.toolStripStatusLabelSpeed.Name = "toolStripStatusLabelSpeed";
-            this.toolStripStatusLabelSpeed.Size = new System.Drawing.Size(62, 17);
-            this.toolStripStatusLabelSpeed.Text = "Скорость:";
-            // 
-            // toolStripStatusLabelWeight
-            // 
-            this.toolStripStatusLabelWeight.Name = "toolStripStatusLabelWeight";
-            this.toolStripStatusLabelWeight.Size = new System.Drawing.Size(29, 17);
-            this.toolStripStatusLabelWeight.Text = "Вес:";
-            // 
-            // toolStripStatusLabelBodyColor
-            // 
-            this.toolStripStatusLabelBodyColor.Name = "toolStripStatusLabelBodyColor";
-            this.toolStripStatusLabelBodyColor.Size = new System.Drawing.Size(36, 17);
-            this.toolStripStatusLabelBodyColor.Text = "Цвет:";
-            // 
-            // buttonCreate
-            // 
-            this.buttonCreate.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
-            this.buttonCreate.Location = new System.Drawing.Point(12, 390);
-            this.buttonCreate.Name = "buttonCreate";
-            this.buttonCreate.Size = new System.Drawing.Size(75, 23);
-            this.buttonCreate.TabIndex = 2;
-            this.buttonCreate.Text = "Создать";
-            this.buttonCreate.UseVisualStyleBackColor = true;
-            this.buttonCreate.Click += new System.EventHandler(this.ButtonCreate_Click);
-            // 
-            // buttonUp
-            // 
-            this.buttonUp.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
-            this.buttonUp.BackgroundImage = global::AirBomber.Properties.Resources.arrowUp;
-            this.buttonUp.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Stretch;
-            this.buttonUp.Location = new System.Drawing.Point(722, 350);
-            this.buttonUp.Name = "buttonUp";
-            this.buttonUp.Size = new System.Drawing.Size(30, 30);
-            this.buttonUp.TabIndex = 3;
-            this.buttonUp.UseVisualStyleBackColor = true;
-            this.buttonUp.Click += new System.EventHandler(this.ButtonMove_Click);
-            // 
-            // buttonLeft
-            // 
-            this.buttonLeft.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
-            this.buttonLeft.BackgroundImage = global::AirBomber.Properties.Resources.arrowLeft;
-            this.buttonLeft.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Stretch;
-            this.buttonLeft.Location = new System.Drawing.Point(686, 386);
-            this.buttonLeft.Name = "buttonLeft";
-            this.buttonLeft.Size = new System.Drawing.Size(30, 30);
-            this.buttonLeft.TabIndex = 4;
-            this.buttonLeft.UseVisualStyleBackColor = true;
-            this.buttonLeft.Click += new System.EventHandler(this.ButtonMove_Click);
-            // 
-            // buttonRight
-            // 
-            this.buttonRight.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
-            this.buttonRight.BackgroundImage = global::AirBomber.Properties.Resources.arrowRight;
-            this.buttonRight.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Stretch;
-            this.buttonRight.Location = new System.Drawing.Point(758, 386);
-            this.buttonRight.Name = "buttonRight";
-            this.buttonRight.Size = new System.Drawing.Size(30, 30);
-            this.buttonRight.TabIndex = 5;
-            this.buttonRight.UseVisualStyleBackColor = true;
-            this.buttonRight.Click += new System.EventHandler(this.ButtonMove_Click);
-            // 
-            // buttonDown
-            // 
-            this.buttonDown.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
-            this.buttonDown.BackgroundImage = global::AirBomber.Properties.Resources.arrowDown;
-            this.buttonDown.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Stretch;
-            this.buttonDown.Location = new System.Drawing.Point(722, 386);
-            this.buttonDown.Name = "buttonDown";
-            this.buttonDown.Size = new System.Drawing.Size(30, 30);
-            this.buttonDown.TabIndex = 6;
-            this.buttonDown.UseVisualStyleBackColor = true;
-            this.buttonDown.Click += new System.EventHandler(this.ButtonMove_Click);
-            // 
-            // buttonCreateModif
-            // 
-            this.buttonCreateModif.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
-            this.buttonCreateModif.Location = new System.Drawing.Point(104, 390);
-            this.buttonCreateModif.Name = "buttonCreateModif";
-            this.buttonCreateModif.Size = new System.Drawing.Size(110, 23);
-            this.buttonCreateModif.TabIndex = 7;
-            this.buttonCreateModif.Text = "Модификация";
-            this.buttonCreateModif.UseVisualStyleBackColor = true;
-            this.buttonCreateModif.Click += new System.EventHandler(this.ButtonCreateModif_Click);
-            // 
-            // comboBoxSelectorMap
-            // 
-            this.comboBoxSelectorMap.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
-            this.comboBoxSelectorMap.FormattingEnabled = true;
-            this.comboBoxSelectorMap.Items.AddRange(new object[] {
-            "Простая карта",
-            "Карта со стенами"});
-            this.comboBoxSelectorMap.Location = new System.Drawing.Point(12, 12);
-            this.comboBoxSelectorMap.Name = "comboBoxSelectorMap";
-            this.comboBoxSelectorMap.Size = new System.Drawing.Size(121, 23);
-            this.comboBoxSelectorMap.TabIndex = 8;
-            this.comboBoxSelectorMap.SelectedIndexChanged += new System.EventHandler(this.ComboBoxSelectorMap_SelectedIndexChanged);
-            // 
-            // FormMap
-            // 
-            this.AutoScaleDimensions = new System.Drawing.SizeF(7F, 15F);
-            this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
-            this.ClientSize = new System.Drawing.Size(800, 450);
-            this.Controls.Add(this.comboBoxSelectorMap);
-            this.Controls.Add(this.buttonCreateModif);
-            this.Controls.Add(this.buttonDown);
-            this.Controls.Add(this.buttonRight);
-            this.Controls.Add(this.buttonLeft);
-            this.Controls.Add(this.buttonUp);
-            this.Controls.Add(this.buttonCreate);
-            this.Controls.Add(this.pictureBoxCar);
-            this.Controls.Add(this.statusStrip);
-            this.Name = "FormMap";
-            this.Text = "Карта";
-            ((System.ComponentModel.ISupportInitialize)(this.pictureBoxCar)).EndInit();
-            this.statusStrip.ResumeLayout(false);
-            this.statusStrip.PerformLayout();
-            this.ResumeLayout(false);
-            this.PerformLayout();
-
-        }
-
-        #endregion
-
-        private PictureBox pictureBoxCar;
-        private StatusStrip statusStrip;
-        private ToolStripStatusLabel toolStripStatusLabelSpeed;
-        private ToolStripStatusLabel toolStripStatusLabelWeight;
-        private ToolStripStatusLabel toolStripStatusLabelBodyColor;
-        private Button buttonCreate;
-        private Button buttonUp;
-        private Button buttonLeft;
-        private Button buttonRight;
-        private Button buttonDown;
-        private Button buttonCreateModif;
-        private ComboBox comboBoxSelectorMap;
-    }
-}
\ No newline at end of file
diff --git a/AirBomber/AirBomber/FormMap.cs b/AirBomber/AirBomber/FormMap.cs
deleted file mode 100644
index c311927..0000000
--- a/AirBomber/AirBomber/FormMap.cs
+++ /dev/null
@@ -1,96 +0,0 @@
-using AirBomber;
-
-namespace AirBomber
-{
-    public partial class FormMap : Form
-    {
-        private AbstractMap _abstractMap;
-
-        public FormMap()
-        {
-            InitializeComponent();
-            _abstractMap = new SimpleMap();
-        }
-        /// <summary>
-        /// Заполнение информации по объекту
-        /// </summary>
-        /// <param name="car"></param>
-        private void SetData(DrawningAirplane car)
-        {
-            toolStripStatusLabelSpeed.Text = $"Скорость: {car.Airplane.Speed}";
-            toolStripStatusLabelWeight.Text = $"Вес: {car.Airplane.Weight}";
-            toolStripStatusLabelBodyColor.Text = $"Цвет: {car.Airplane.BodyColor.Name}";
-            pictureBoxCar.Image = _abstractMap.CreateMap(pictureBoxCar.Width, pictureBoxCar.Height,
-                new DrawningObject(car));
-        }
-        /// <summary>
-        /// Обработка нажатия кнопки "Создать"
-        /// </summary>
-        /// <param name="sender"></param>
-        /// <param name="e"></param>
-        private void ButtonCreate_Click(object sender, EventArgs e)
-        {
-            Random rnd = new();
-            var car = new DrawningAirplane(rnd.Next(100, 300), rnd.Next(1000, 2000), Color.FromArgb(rnd.Next(0, 256), rnd.Next(0, 256), rnd.Next(0, 256)));
-            SetData(car);
-        }
-        /// <summary>
-        /// Изменение размеров формы
-        /// </summary>
-        /// <param name="sender"></param>
-        /// <param name="e"></param>
-        private void ButtonMove_Click(object sender, EventArgs e)
-        {
-            //получаем имя кнопки
-            string name = ((Button)sender)?.Name ?? string.Empty;
-            Direction dir = Direction.None;
-            switch (name)
-            {
-                case "buttonUp":
-                    dir = Direction.Up;
-                    break;
-                case "buttonDown":
-                    dir = Direction.Down;
-                    break;
-                case "buttonLeft":
-                    dir = Direction.Left;
-                    break;
-                case "buttonRight":
-                    dir = Direction.Right;
-                    break;
-            }
-            pictureBoxCar.Image = _abstractMap?.MoveObject(dir);
-        }
-        /// <summary>
-        /// Обработка нажатия кнопки "Модификация"
-        /// </summary>
-        /// <param name="sender"></param>
-        /// <param name="e"></param>
-        private void ButtonCreateModif_Click(object sender, EventArgs e)
-        {
-            Random rnd = new();
-            var car = new DrawningAirBomber(rnd.Next(100, 300), rnd.Next(1000, 2000),
-                Color.FromArgb(rnd.Next(0, 256), rnd.Next(0, 256), rnd.Next(0, 256)),
-                Color.FromArgb(rnd.Next(0, 256), rnd.Next(0, 256), rnd.Next(0, 256)),
-                Convert.ToBoolean(rnd.Next(0, 2)), Convert.ToBoolean(rnd.Next(0, 2)));
-            SetData(car);
-        }
-        /// <summary>
-        /// Смена карты
-        /// </summary>
-        /// <param name="sender"></param>
-        /// <param name="e"></param>
-        private void ComboBoxSelectorMap_SelectedIndexChanged(object sender, EventArgs e)
-        {
-            switch (comboBoxSelectorMap.Text)
-            {
-                case "Простая карта":
-                    _abstractMap = new SimpleMap();
-                    break;
-                case "Карта со стенами":
-                    _abstractMap = new WallMap();
-                    break;
-            }
-        }
-    }
-}
diff --git a/AirBomber/AirBomber/FormMap.resx b/AirBomber/AirBomber/FormMap.resx
deleted file mode 100644
index 2c0949d..0000000
--- a/AirBomber/AirBomber/FormMap.resx
+++ /dev/null
@@ -1,63 +0,0 @@
-<root>
-  <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>
-  <metadata name="statusStrip.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
-    <value>17, 17</value>
-  </metadata>
-</root>
\ No newline at end of file
diff --git a/AirBomber/AirBomber/FormMapWithSetAirplanes.Designer.cs b/AirBomber/AirBomber/FormMapWithSetAirplanes.Designer.cs
index 86f17b8..ed972c8 100644
--- a/AirBomber/AirBomber/FormMapWithSetAirplanes.Designer.cs
+++ b/AirBomber/AirBomber/FormMapWithSetAirplanes.Designer.cs
@@ -81,7 +81,7 @@
             this.buttonRemoveAirplane.TabIndex = 3;
             this.buttonRemoveAirplane.Text = "Удалить самолет";
             this.buttonRemoveAirplane.UseVisualStyleBackColor = true;
-            this.buttonRemoveAirplane.Click += new System.EventHandler(this.ButtonRemoveCar_Click);
+            this.buttonRemoveAirplane.Click += new System.EventHandler(this.ButtonRemoveAirplane_Click);
             // 
             // buttonShowStorage
             // 
@@ -155,7 +155,7 @@
             this.buttonAddAirplane.TabIndex = 1;
             this.buttonAddAirplane.Text = "Добавить самолет";
             this.buttonAddAirplane.UseVisualStyleBackColor = true;
-            this.buttonAddAirplane.Click += new System.EventHandler(this.ButtonAddCar_Click);
+            this.buttonAddAirplane.Click += new System.EventHandler(this.ButtonAddAirplane_Click);
             // 
             // comboBoxSelectorMap
             // 
@@ -178,14 +178,14 @@
             this.pictureBox.TabIndex = 1;
             this.pictureBox.TabStop = false;
             // 
-            // FormMapWithSetCars
+            // FormMapWithSetAirplanes
             // 
             this.AutoScaleDimensions = new System.Drawing.SizeF(7F, 15F);
             this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
             this.ClientSize = new System.Drawing.Size(1015, 554);
             this.Controls.Add(this.pictureBox);
             this.Controls.Add(this.groupBoxTools);
-            this.Name = "FormMapWithSetCars";
+            this.Name = "FormMapWithSetAirplanes";
             this.Text = "Карта с набором объектов";
             this.groupBoxTools.ResumeLayout(false);
             this.groupBoxTools.PerformLayout();
diff --git a/AirBomber/AirBomber/FormMapWithSetAirplanes.cs b/AirBomber/AirBomber/FormMapWithSetAirplanes.cs
index 1adaa30..9676d84 100644
--- a/AirBomber/AirBomber/FormMapWithSetAirplanes.cs
+++ b/AirBomber/AirBomber/FormMapWithSetAirplanes.cs
@@ -42,7 +42,7 @@
         /// </summary>
         /// <param name="sender"></param>
         /// <param name="e"></param>
-        private void ButtonAddCar_Click(object sender, EventArgs e)
+        private void ButtonAddAirplane_Click(object sender, EventArgs e)
         {
             if(_mapAirplanesCollectionGeneric == null)
             {
@@ -51,8 +51,8 @@
             FormAirBomber form = new();
             if (form.ShowDialog() == DialogResult.OK)
             {
-                DrawningObject car = new(form.SelectedAirplane);
-                if (_mapAirplanesCollectionGeneric + car)
+                DrawningObject airplane = new(form.SelectedAirplane);
+                if (_mapAirplanesCollectionGeneric + airplane)
                 {
                     MessageBox.Show("Объект добавлен");
                     pictureBox.Image = _mapAirplanesCollectionGeneric.ShowSet();
@@ -68,7 +68,7 @@
         /// </summary>
         /// <param name="sender"></param>
         /// <param name="e"></param>
-        private void ButtonRemoveCar_Click(object sender, EventArgs e)
+        private void ButtonRemoveAirplane_Click(object sender, EventArgs e)
         {
             if (string.IsNullOrEmpty(maskedTextBoxPosition.Text))
             {
-- 
2.25.1


From caacb5672f1c09ad8c02eef8314be4f654ea3e12 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=D0=94=D0=B0=D0=BD=D0=B8=D1=8F=D1=80=20=D0=90=D0=B3=D0=BB?=
 =?UTF-8?q?=D0=B8=D1=83=D0=BB=D0=BB=D0=BE=D0=B2?= <danuar228@mail.ru>
Date: Thu, 29 Sep 2022 22:23:01 +0400
Subject: [PATCH 04/14] =?UTF-8?q?=D0=97=D0=B0=D0=BC=D0=B5=D0=BD=D0=B0=20pi?=
 =?UTF-8?q?ctureBoxCar?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

---
 AirBomber/AirBomber/FormAirBomber.cs | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/AirBomber/AirBomber/FormAirBomber.cs b/AirBomber/AirBomber/FormAirBomber.cs
index ec360b8..d412dc9 100644
--- a/AirBomber/AirBomber/FormAirBomber.cs
+++ b/AirBomber/AirBomber/FormAirBomber.cs
@@ -29,7 +29,7 @@ namespace AirBomber
         private void SetData()
         {
             Random rnd = new();
-            _airplane.SetPosition(rnd.Next(10, 100), rnd.Next(10, 100), pictureBoxCar.Width, pictureBoxCar.Height);
+            _airplane.SetPosition(rnd.Next(10, 100), rnd.Next(10, 100), pictureBoxAirplane.Width, pictureBoxAirplane.Height);
             toolStripStatusLabelSpeed.Text = $"��������: {_airplane.Airplane.Speed}";
             toolStripStatusLabelWeight.Text = $"���: {_airplane.Airplane.Weight}";
             toolStripStatusLabelBodyColor.Text = $"����: {_airplane.Airplane.BodyColor.Name}";
@@ -119,7 +119,7 @@ namespace AirBomber
         /// </summary>
         /// <param name="sender"></param>
         /// <param name="e"></param>
-        private void ButtonSelectCar_Click(object sender, EventArgs e)
+        private void ButtonSelectAirplane_Click(object sender, EventArgs e)
         {
             SelectedAirplane = _airplane;
             DialogResult = DialogResult.OK;
-- 
2.25.1


From 340744510b60ca139c18745d52d2bd1727aaa459 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=D0=94=D0=B0=D0=BD=D0=B8=D1=8F=D1=80=20=D0=90=D0=B3=D0=BB?=
 =?UTF-8?q?=D0=B8=D1=83=D0=BB=D0=BB=D0=BE=D0=B2?= <danuar228@mail.ru>
Date: Fri, 30 Sep 2022 15:44:29 +0400
Subject: [PATCH 05/14] =?UTF-8?q?=D0=94=D0=BE=D0=BF=D0=B8=D0=BB=D0=B5?=
 =?UTF-8?q?=D0=BD=D0=B0=20=D0=BB=D0=BE=D0=B3=D0=B8=D0=BA=D0=B0=20=D0=B2=20?=
 =?UTF-8?q?SetAirplanesGeneric?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

---
 AirBomber/AirBomber/SetAirplanesGeneric.cs | 36 +++++++++++++++-------
 1 file changed, 25 insertions(+), 11 deletions(-)

diff --git a/AirBomber/AirBomber/SetAirplanesGeneric.cs b/AirBomber/AirBomber/SetAirplanesGeneric.cs
index ab32adf..0848595 100644
--- a/AirBomber/AirBomber/SetAirplanesGeneric.cs
+++ b/AirBomber/AirBomber/SetAirplanesGeneric.cs
@@ -36,8 +36,12 @@ namespace AirBomber
         /// <returns></returns>
         public bool Insert(T airplane)
         {
-            // TODO вставка в начало набора
-            return true;
+            return Insert(airplane, 0);
+        }
+
+        private bool isCorrectPosition(int position)
+        {
+            return 0 < position && position <= Count;
         }
         /// <summary>
         /// Добавление объекта в набор на конкретную позицию
@@ -47,11 +51,21 @@ namespace AirBomber
         /// <returns></returns>
         public bool Insert(T airplane, int position)
         {
-            // TODO проверка позиции
-            // TODO проверка, что элемент массива по этой позиции пустой, если нет, то
-            //		проверка, что после вставляемого элемента в массиве есть пустой элемент
-            //		сдвиг всех объектов, находящихся справа от позиции до первого пустого элемента
-            // TODO вставка по позиции
+            int positionNullElement = position;
+            while (Get(positionNullElement) != null)
+            {
+                positionNullElement++;
+            }
+            // Если изначальная позиция была некорректной или пустых элементов справа не оказалось возвращаем false
+            if (!isCorrectPosition(positionNullElement)) 
+            {
+                return false;
+            }
+            while (positionNullElement != position) // Смещение вправо
+            {
+                _places[positionNullElement] = _places[positionNullElement - 1];
+                positionNullElement--;
+            }
             _places[position] = airplane;
             return true;
         }
@@ -62,8 +76,9 @@ namespace AirBomber
         /// <returns></returns>
         public bool Remove(int position)
         {
-            // TODO проверка позиции
-            // TODO удаление объекта из массива, присовив элементу массива значение null
+            if (!isCorrectPosition(position))
+                return false;
+            _places[position] = null;
             return true;
         }
         /// <summary>
@@ -73,8 +88,7 @@ namespace AirBomber
         /// <returns></returns>
         public T Get(int position)
         {
-            // TODO проверка позиции
-            return _places[position];
+            return isCorrectPosition(position) ? _places[position] : null;
         }
     }
 }
-- 
2.25.1


From 70641cea7f9d010382d2a63fa8854195eb58d9cc Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=D0=94=D0=B0=D0=BD=D0=B8=D1=8F=D1=80=20=D0=90=D0=B3=D0=BB?=
 =?UTF-8?q?=D0=B8=D1=83=D0=BB=D0=BB=D0=BE=D0=B2?= <danuar228@mail.ru>
Date: Fri, 30 Sep 2022 16:37:59 +0400
Subject: [PATCH 06/14] =?UTF-8?q?=D0=9F=D1=80=D0=B0=D0=B2=D0=BA=D0=B8=20?=
 =?UTF-8?q?=D0=B4=D0=BB=D1=8F=20=D0=BA=D0=BE=D1=80=D1=80=D0=B5=D0=BA=D1=82?=
 =?UTF-8?q?=D0=BD=D0=BE=D0=B3=D0=BE=20=D0=B4=D0=BE=D0=B1=D0=B0=D0=B2=D0=BB?=
 =?UTF-8?q?=D0=B5=D0=BD=D0=B8=D1=8F=20=D0=BE=D0=B1=D1=8A=D0=B5=D0=BA=D1=82?=
 =?UTF-8?q?=D0=BE=D0=B2?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

---
 AirBomber/AirBomber/DrawningObject.cs                 |  2 +-
 .../AirBomber/FormMapWithSetAirplanes.Designer.cs     |  2 +-
 AirBomber/AirBomber/FormMapWithSetAirplanes.cs        | 11 +++++++----
 AirBomber/AirBomber/MapWithSetAirplanesGeneric.cs     |  4 ++--
 AirBomber/AirBomber/SetAirplanesGeneric.cs            |  2 +-
 5 files changed, 12 insertions(+), 9 deletions(-)

diff --git a/AirBomber/AirBomber/DrawningObject.cs b/AirBomber/AirBomber/DrawningObject.cs
index d79a291..dca9b4d 100644
--- a/AirBomber/AirBomber/DrawningObject.cs
+++ b/AirBomber/AirBomber/DrawningObject.cs
@@ -34,7 +34,7 @@ namespace AirBomber
 
         void IDrawningObject.DrawningObject(Graphics g)
         {
-            _airplane.DrawTransport(g);
+            _airplane?.DrawTransport(g);
         }
     }
 }
diff --git a/AirBomber/AirBomber/FormMapWithSetAirplanes.Designer.cs b/AirBomber/AirBomber/FormMapWithSetAirplanes.Designer.cs
index ed972c8..8d581aa 100644
--- a/AirBomber/AirBomber/FormMapWithSetAirplanes.Designer.cs
+++ b/AirBomber/AirBomber/FormMapWithSetAirplanes.Designer.cs
@@ -162,7 +162,7 @@
             this.comboBoxSelectorMap.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
             this.comboBoxSelectorMap.FormattingEnabled = true;
             this.comboBoxSelectorMap.Items.AddRange(new object[] {
-            "Простая карта"});
+            "Простая карта", "Карта со стенами"});
             this.comboBoxSelectorMap.Location = new System.Drawing.Point(17, 32);
             this.comboBoxSelectorMap.Name = "comboBoxSelectorMap";
             this.comboBoxSelectorMap.Size = new System.Drawing.Size(175, 23);
diff --git a/AirBomber/AirBomber/FormMapWithSetAirplanes.cs b/AirBomber/AirBomber/FormMapWithSetAirplanes.cs
index 9676d84..def5d4e 100644
--- a/AirBomber/AirBomber/FormMapWithSetAirplanes.cs
+++ b/AirBomber/AirBomber/FormMapWithSetAirplanes.cs
@@ -26,6 +26,9 @@
                 case "Простая карта":
                     map = new SimpleMap();
                     break;
+                case "Карта со стенами":
+                    map = new WallMap();
+                    break;
             }
             if (map != null)
             {
@@ -52,14 +55,14 @@
             if (form.ShowDialog() == DialogResult.OK)
             {
                 DrawningObject airplane = new(form.SelectedAirplane);
-                if (_mapAirplanesCollectionGeneric + airplane)
+                if (form.SelectedAirplane == null || !(_mapAirplanesCollectionGeneric + airplane))
                 {
-                    MessageBox.Show("Объект добавлен");
-                    pictureBox.Image = _mapAirplanesCollectionGeneric.ShowSet();
+                    MessageBox.Show("Не удалось добавить объект");
                 }
                 else
                 {
-                    MessageBox.Show("Не удалось добавить объект");
+                    MessageBox.Show("Объект добавлен");
+                    pictureBox.Image = _mapAirplanesCollectionGeneric.ShowSet();
                 }
             }
         }
diff --git a/AirBomber/AirBomber/MapWithSetAirplanesGeneric.cs b/AirBomber/AirBomber/MapWithSetAirplanesGeneric.cs
index e54e7a8..63bb08f 100644
--- a/AirBomber/AirBomber/MapWithSetAirplanesGeneric.cs
+++ b/AirBomber/AirBomber/MapWithSetAirplanesGeneric.cs
@@ -78,7 +78,7 @@ namespace AirBomber
             Bitmap bmp = new(_pictureWidth, _pictureHeight);
             Graphics gr = Graphics.FromImage(bmp);
             DrawBackground(gr);
-            Drawairplanes(gr);
+            DrawAirplanes(gr);
             return bmp;
         }
         /// <summary>
@@ -158,7 +158,7 @@ namespace AirBomber
         /// Метод прорисовки объектов
         /// </summary>
         /// <param name="g"></param>
-        private void Drawairplanes(Graphics g)
+        private void DrawAirplanes(Graphics g)
         {
             for (int i = 0; i < _setAirplanes.Count; i++)
             {
diff --git a/AirBomber/AirBomber/SetAirplanesGeneric.cs b/AirBomber/AirBomber/SetAirplanesGeneric.cs
index 0848595..178d798 100644
--- a/AirBomber/AirBomber/SetAirplanesGeneric.cs
+++ b/AirBomber/AirBomber/SetAirplanesGeneric.cs
@@ -41,7 +41,7 @@ namespace AirBomber
 
         private bool isCorrectPosition(int position)
         {
-            return 0 < position && position <= Count;
+            return 0 <= position && position < Count;
         }
         /// <summary>
         /// Добавление объекта в набор на конкретную позицию
-- 
2.25.1


From 958cddcd6af9dffd19ea9bdc5ab0a385158ca315 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=D0=94=D0=B0=D0=BD=D0=B8=D1=8F=D1=80=20=D0=90=D0=B3=D0=BB?=
 =?UTF-8?q?=D0=B8=D1=83=D0=BB=D0=BB=D0=BE=D0=B2?= <danuar228@mail.ru>
Date: Fri, 30 Sep 2022 17:49:33 +0400
Subject: [PATCH 07/14] =?UTF-8?q?=D0=A1=D0=BF=D0=B0=D1=83=D0=BD=20=D1=81?=
 =?UTF-8?q?=D0=B0=D0=BC=D0=BE=D0=BB=D0=B5=D1=82=D0=BE=D0=B2=20=D0=BD=D0=B0?=
 =?UTF-8?q?=D0=BB=D0=B5=D0=B2=D0=BE=20=D0=B8=20=D0=B2=D0=BD=D0=B8=D0=B7?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

---
 AirBomber/AirBomber/MapWithSetAirplanesGeneric.cs | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/AirBomber/AirBomber/MapWithSetAirplanesGeneric.cs b/AirBomber/AirBomber/MapWithSetAirplanesGeneric.cs
index 63bb08f..352064c 100644
--- a/AirBomber/AirBomber/MapWithSetAirplanesGeneric.cs
+++ b/AirBomber/AirBomber/MapWithSetAirplanesGeneric.cs
@@ -160,10 +160,13 @@ namespace AirBomber
         /// <param name="g"></param>
         private void DrawAirplanes(Graphics g)
         {
+            int countInLine = _pictureWidth / _placeSizeWidth;
+            int maxLeft = (countInLine - 1) * _placeSizeWidth;
             for (int i = 0; i < _setAirplanes.Count; i++)
             {
-                // TODO установка позиции
-                _setAirplanes.Get(i)?.DrawningObject(g);
+                var airplane = _setAirplanes.Get(i);
+                airplane?.SetObject(maxLeft - i % countInLine * _placeSizeWidth, i / countInLine * _placeSizeHeight, _pictureWidth, _pictureHeight);
+                airplane?.DrawningObject(g);
             }
         }
     }
-- 
2.25.1


From 1d3cf33ca356265b6adaf2b776a27942e0477c52 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=D0=94=D0=B0=D0=BD=D0=B8=D1=8F=D1=80=20=D0=90=D0=B3=D0=BB?=
 =?UTF-8?q?=D0=B8=D1=83=D0=BB=D0=BB=D0=BE=D0=B2?= <danuar228@mail.ru>
Date: Fri, 30 Sep 2022 18:24:01 +0400
Subject: [PATCH 08/14] =?UTF-8?q?=D0=9F=D0=BE=D0=B4=D0=BA=D0=BE=D1=80?=
 =?UTF-8?q?=D1=80=D0=B5=D0=BA=D1=82=D0=B8=D1=80=D0=BE=D0=B2=D0=B0=D0=BD?=
 =?UTF-8?q?=D1=8B=20=D1=80=D0=B0=D0=B7=D0=BC=D0=B5=D1=80=D1=8B=20=D1=81?=
 =?UTF-8?q?=D0=B0=D0=BC=D0=BE=D0=BB=D0=B5=D1=82=D0=BE=D0=B2=20=D0=B8=20?=
 =?UTF-8?q?=D0=B0=D0=BD=D0=B3=D0=B0=D1=80=D0=B0?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

---
 AirBomber/AirBomber/DrawningAirBomber.cs      |  2 +-
 .../AirBomber/MapWithSetAirplanesGeneric.cs   | 23 ++++++++++++++-----
 2 files changed, 18 insertions(+), 7 deletions(-)

diff --git a/AirBomber/AirBomber/DrawningAirBomber.cs b/AirBomber/AirBomber/DrawningAirBomber.cs
index 2f5da52..0705593 100644
--- a/AirBomber/AirBomber/DrawningAirBomber.cs
+++ b/AirBomber/AirBomber/DrawningAirBomber.cs
@@ -20,7 +20,7 @@ namespace AirBomber
         /// <param name="hasBombs">Признак наличия бомб</param>
         /// <param name="hasFuelTanks">Признак наличия топливных баков</param>
         public DrawningAirBomber(int speed, float weight, Color bodyColor, Color dopColor, bool hasBombs, bool hasFuelTanks) 
-            : base(speed, weight, bodyColor, 115, 155)
+            : base(speed, weight, bodyColor, 95, 110)
         {
             Airplane = new EntityAirBomber(speed, weight, bodyColor, dopColor, hasBombs, hasFuelTanks);
         }
diff --git a/AirBomber/AirBomber/MapWithSetAirplanesGeneric.cs b/AirBomber/AirBomber/MapWithSetAirplanesGeneric.cs
index 352064c..f1b5c96 100644
--- a/AirBomber/AirBomber/MapWithSetAirplanesGeneric.cs
+++ b/AirBomber/AirBomber/MapWithSetAirplanesGeneric.cs
@@ -25,7 +25,7 @@ namespace AirBomber
         /// <summary>
         /// Размер занимаемого объектом места (высота)
         /// </summary>
-        private readonly int _placeSizeHeight = 90;
+        private readonly int _placeSizeHeight = 190;
         /// <summary>
         /// Набор объектов
         /// </summary>
@@ -147,13 +147,24 @@ namespace AirBomber
             Pen pen = new(Color.Black, 3);
             for (int i = 0; i < _pictureWidth / _placeSizeWidth; i++)
             {
-                for (int j = 0; j < _pictureHeight / _placeSizeHeight + 1; ++j)
-                {//линия рамзетки места
-                    g.DrawLine(pen, i * _placeSizeWidth, j * _placeSizeHeight, i * _placeSizeWidth + _placeSizeWidth / 2, j * _placeSizeHeight);
+                for (int j = 0; j < _pictureHeight / _placeSizeHeight + 1; j++)
+                {
+                    DrawHangar(g, pen, new RectangleF(i * _placeSizeWidth, j * _placeSizeHeight, _placeSizeWidth / 1.8F, _placeSizeHeight / 1.6F));
+                    // g.DrawLine(pen, i * _placeSizeWidth, j * _placeSizeHeight, i * _placeSizeWidth + _placeSizeWidth / 2, j * _placeSizeHeight);
                 }
-                g.DrawLine(pen, i * _placeSizeWidth, 0, i * _placeSizeWidth, (_pictureHeight / _placeSizeHeight) * _placeSizeHeight);
             }
         }
+
+        private void DrawHangar(Graphics g, Pen pen, RectangleF rect)
+        {
+            g.DrawLine(pen, rect.Left , rect.Top   , rect.Right, rect.Top   );
+            g.DrawLine(pen, rect.Right, rect.Top   , rect.Right, rect.Bottom);
+            g.DrawLine(pen, rect.Right, rect.Bottom, rect.Left , rect.Bottom);
+
+            // Края ворот ангара
+            g.DrawLine(pen, rect.Left, rect.Top   , rect.Left, rect.Top    + rect.Height / 10);
+            g.DrawLine(pen, rect.Left, rect.Bottom, rect.Left, rect.Bottom - rect.Height / 10);
+        }
         /// <summary>
         /// Метод прорисовки объектов
         /// </summary>
@@ -165,7 +176,7 @@ namespace AirBomber
             for (int i = 0; i < _setAirplanes.Count; i++)
             {
                 var airplane = _setAirplanes.Get(i);
-                airplane?.SetObject(maxLeft - i % countInLine * _placeSizeWidth, i / countInLine * _placeSizeHeight, _pictureWidth, _pictureHeight);
+                airplane?.SetObject(maxLeft - i % countInLine * _placeSizeWidth, i / countInLine * _placeSizeHeight + 3, _pictureWidth, _pictureHeight);
                 airplane?.DrawningObject(g);
             }
         }
-- 
2.25.1


From 81b1b26dc68a90e39488dca7c70224fa755f2968 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=D0=94=D0=B0=D0=BD=D0=B8=D1=8F=D1=80=20=D0=90=D0=B3=D0=BB?=
 =?UTF-8?q?=D0=B8=D1=83=D0=BB=D0=BB=D0=BE=D0=B2?= <danuar228@mail.ru>
Date: Sat, 1 Oct 2022 01:59:37 +0400
Subject: [PATCH 09/14] =?UTF-8?q?=D0=A3=D0=B4=D0=B0=D0=BB=D0=B5=D0=BD=20?=
 =?UTF-8?q?=D0=B7=D0=B0=D0=BA=D0=BE=D0=BC=D0=BC=D0=B5=D0=BD=D1=82=D0=B8?=
 =?UTF-8?q?=D1=80=D0=BE=D0=B2=D0=B0=D0=BD=D0=BD=D1=8B=D0=B9=20=D0=BA=D0=BE?=
 =?UTF-8?q?=D0=B4?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

---
 AirBomber/AirBomber/MapWithSetAirplanesGeneric.cs | 1 -
 1 file changed, 1 deletion(-)

diff --git a/AirBomber/AirBomber/MapWithSetAirplanesGeneric.cs b/AirBomber/AirBomber/MapWithSetAirplanesGeneric.cs
index f1b5c96..a7af139 100644
--- a/AirBomber/AirBomber/MapWithSetAirplanesGeneric.cs
+++ b/AirBomber/AirBomber/MapWithSetAirplanesGeneric.cs
@@ -150,7 +150,6 @@ namespace AirBomber
                 for (int j = 0; j < _pictureHeight / _placeSizeHeight + 1; j++)
                 {
                     DrawHangar(g, pen, new RectangleF(i * _placeSizeWidth, j * _placeSizeHeight, _placeSizeWidth / 1.8F, _placeSizeHeight / 1.6F));
-                    // g.DrawLine(pen, i * _placeSizeWidth, j * _placeSizeHeight, i * _placeSizeWidth + _placeSizeWidth / 2, j * _placeSizeHeight);
                 }
             }
         }
-- 
2.25.1


From e89afef20860d6a8ac6738e6e04d7bfde7cabeeb Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=D0=94=D0=B0=D0=BD=D0=B8=D1=8F=D1=80=20=D0=90=D0=B3=D0=BB?=
 =?UTF-8?q?=D0=B8=D1=83=D0=BB=D0=BB=D0=BE=D0=B2?= <danuar228@mail.ru>
Date: Sat, 1 Oct 2022 05:24:33 +0400
Subject: [PATCH 10/14] =?UTF-8?q?=D0=98=D0=B7=D0=BC=D0=B5=D0=BD=D0=B5?=
 =?UTF-8?q?=D0=BD=D0=B8=D0=B5=20=D0=BC=D0=B5=D1=82=D0=BE=D0=B4=D0=B0?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

---
 AirBomber/AirBomber/DrawningObject.cs | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/AirBomber/AirBomber/DrawningObject.cs b/AirBomber/AirBomber/DrawningObject.cs
index dca9b4d..324ce4b 100644
--- a/AirBomber/AirBomber/DrawningObject.cs
+++ b/AirBomber/AirBomber/DrawningObject.cs
@@ -32,7 +32,7 @@ namespace AirBomber
             _airplane.SetPosition(x, y, width, height);
         }
 
-        void IDrawningObject.DrawningObject(Graphics g)
+        public void DrawObject(Graphics g)
         {
             _airplane?.DrawTransport(g);
         }
-- 
2.25.1


From bbbd2b794ae6764e900b6b1ff71c4dcd4e4e89d0 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=D0=94=D0=B0=D0=BD=D0=B8=D1=8F=D1=80=20=D0=90=D0=B3=D0=BB?=
 =?UTF-8?q?=D0=B8=D1=83=D0=BB=D0=BB=D0=BE=D0=B2?= <danuar228@mail.ru>
Date: Sat, 1 Oct 2022 05:32:04 +0400
Subject: [PATCH 11/14] =?UTF-8?q?=D0=98=D1=81=D0=BF=D1=80=D0=B0=D0=B2?=
 =?UTF-8?q?=D0=BB=D0=B5=D0=BD=D0=BE=20=D0=BE=D1=88=D0=B8=D0=B1=D0=BA=D0=B0?=
 =?UTF-8?q?=20=D1=81=20=D0=BD=D0=B0=D0=B7=D0=B2=D0=B0=D0=BD=D0=B8=D0=B5?=
 =?UTF-8?q?=D0=BC=20=D0=BC=D0=B5=D1=82=D0=BE=D0=B4=D0=B0?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

---
 AirBomber/AirBomber/AbstractMap.cs     | 2 +-
 AirBomber/AirBomber/IDrawningObject.cs | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/AirBomber/AirBomber/AbstractMap.cs b/AirBomber/AirBomber/AbstractMap.cs
index 78425d8..8cc655f 100644
--- a/AirBomber/AirBomber/AbstractMap.cs
+++ b/AirBomber/AirBomber/AbstractMap.cs
@@ -162,7 +162,7 @@ namespace AirBomber
                 DrawMap();
             if (_staticBitMap != null)
                 gr.DrawImage(_staticBitMap, 0, 0);
-            _drawningObject.DrawningObject(gr);
+            _drawningObject.DrawObject(gr);
             return bmp;
         }
 
diff --git a/AirBomber/AirBomber/IDrawningObject.cs b/AirBomber/AirBomber/IDrawningObject.cs
index 6077012..a2afce7 100644
--- a/AirBomber/AirBomber/IDrawningObject.cs
+++ b/AirBomber/AirBomber/IDrawningObject.cs
@@ -33,7 +33,7 @@ namespace AirBomber
         /// Отрисовка объекта
         /// </summary>
         /// <param name="g"></param>
-        void DrawningObject(Graphics g);
+        void DrawObject(Graphics g);
         /// <summary>
         /// Получение текущей позиции объекта
         /// </summary>
-- 
2.25.1


From d58705a5b24857c2a1e22474060dd75cdaeb3d7d Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=D0=94=D0=B0=D0=BD=D0=B8=D1=8F=D1=80=20=D0=90=D0=B3=D0=BB?=
 =?UTF-8?q?=D0=B8=D1=83=D0=BB=D0=BB=D0=BE=D0=B2?= <danuar228@mail.ru>
Date: Sat, 1 Oct 2022 05:54:28 +0400
Subject: [PATCH 12/14] =?UTF-8?q?=D0=9F=D0=B5=D1=80=D0=B5=D0=B8=D0=BC?=
 =?UTF-8?q?=D0=B5=D0=BD=D0=BE=D0=B2=D0=B0=D0=BD=D0=B8=D0=B5=20=D0=BC=D0=B5?=
 =?UTF-8?q?=D1=82=D0=BE=D0=B4=D0=B0?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

---
 AirBomber/AirBomber/MapWithSetAirplanesGeneric.cs | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/AirBomber/AirBomber/MapWithSetAirplanesGeneric.cs b/AirBomber/AirBomber/MapWithSetAirplanesGeneric.cs
index a7af139..775f1f7 100644
--- a/AirBomber/AirBomber/MapWithSetAirplanesGeneric.cs
+++ b/AirBomber/AirBomber/MapWithSetAirplanesGeneric.cs
@@ -176,7 +176,7 @@ namespace AirBomber
             {
                 var airplane = _setAirplanes.Get(i);
                 airplane?.SetObject(maxLeft - i % countInLine * _placeSizeWidth, i / countInLine * _placeSizeHeight + 3, _pictureWidth, _pictureHeight);
-                airplane?.DrawningObject(g);
+                airplane?.DrawObject(g);
             }
         }
     }
-- 
2.25.1


From 19eeb2b95052758b86f013213d93bfd86e044972 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=D0=94=D0=B0=D0=BD=D0=B8=D1=8F=D1=80=20=D0=90=D0=B3=D0=BB?=
 =?UTF-8?q?=D0=B8=D1=83=D0=BB=D0=BB=D0=BE=D0=B2?= <danuar228@mail.ru>
Date: Tue, 4 Oct 2022 03:00:30 +0400
Subject: [PATCH 13/14] =?UTF-8?q?=D0=94=D0=BE=D0=B1=D0=B0=D0=B2=D0=BB?=
 =?UTF-8?q?=D0=B5=D0=BD=D0=B0=20=D0=B2=D0=BE=D0=B7=D0=BC=D0=BE=D0=B6=D0=BD?=
 =?UTF-8?q?=D0=BE=D1=81=D1=82=D1=8C=20=D0=BF=D0=B5=D1=80=D0=B5=D0=BC=D0=B5?=
 =?UTF-8?q?=D1=89=D0=B0=D1=82=D1=8C=20=D1=81=D0=B0=D0=BC=D0=BE=D0=BB=D0=B5?=
 =?UTF-8?q?=D1=82=20=D0=BF=D0=BE=20=D0=BA=D0=B0=D1=80=D1=82=D0=B5,=20?=
 =?UTF-8?q?=D0=B8=20=D0=BD=D0=B5=20=D0=BF=D0=B5=D1=80=D0=B5=D0=BC=D0=B5?=
 =?UTF-8?q?=D1=89=D0=B0=D1=82=D1=8C=20=D0=B2=20=D1=85=D1=80=D0=B0=D0=BD?=
 =?UTF-8?q?=D0=B8=D0=BB=D0=B8=D1=89=D0=B5?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

---
 AirBomber/AirBomber/AbstractMap.cs                      | 2 ++
 AirBomber/AirBomber/FormMapWithSetAirplanes.Designer.cs | 7 ++++++-
 AirBomber/AirBomber/FormMapWithSetAirplanes.cs          | 2 +-
 AirBomber/AirBomber/MapWithSetAirplanesGeneric.cs       | 9 ++++++---
 4 files changed, 15 insertions(+), 5 deletions(-)

diff --git a/AirBomber/AirBomber/AbstractMap.cs b/AirBomber/AirBomber/AbstractMap.cs
index 8cc655f..62dbec5 100644
--- a/AirBomber/AirBomber/AbstractMap.cs
+++ b/AirBomber/AirBomber/AbstractMap.cs
@@ -34,6 +34,8 @@ namespace AirBomber
             return DrawMapWithObject();
         }
 
+        public bool HasMap => _map != null;
+
         /// <summary>Проверяет наличие непроходимых участков в заданной области</summary>
         /// <param name="area">Заданная область</param>
         /// <param name="iBarrier">i-ый индекс первого барьера, который был найден в области</param>
diff --git a/AirBomber/AirBomber/FormMapWithSetAirplanes.Designer.cs b/AirBomber/AirBomber/FormMapWithSetAirplanes.Designer.cs
index 8d581aa..7d612bd 100644
--- a/AirBomber/AirBomber/FormMapWithSetAirplanes.Designer.cs
+++ b/AirBomber/AirBomber/FormMapWithSetAirplanes.Designer.cs
@@ -103,6 +103,7 @@
             this.buttonDown.Size = new System.Drawing.Size(30, 30);
             this.buttonDown.TabIndex = 10;
             this.buttonDown.UseVisualStyleBackColor = true;
+            this.buttonDown.Click += new System.EventHandler(this.ButtonMove_Click);
             // 
             // buttonRight
             // 
@@ -114,6 +115,7 @@
             this.buttonRight.Size = new System.Drawing.Size(30, 30);
             this.buttonRight.TabIndex = 9;
             this.buttonRight.UseVisualStyleBackColor = true;
+            this.buttonRight.Click += new System.EventHandler(this.ButtonMove_Click);
             // 
             // buttonLeft
             // 
@@ -125,6 +127,7 @@
             this.buttonLeft.Size = new System.Drawing.Size(30, 30);
             this.buttonLeft.TabIndex = 8;
             this.buttonLeft.UseVisualStyleBackColor = true;
+            this.buttonLeft.Click += new System.EventHandler(this.ButtonMove_Click);
             // 
             // buttonUp
             // 
@@ -136,6 +139,7 @@
             this.buttonUp.Size = new System.Drawing.Size(30, 30);
             this.buttonUp.TabIndex = 7;
             this.buttonUp.UseVisualStyleBackColor = true;
+            this.buttonUp.Click += new System.EventHandler(this.ButtonMove_Click);
             // 
             // buttonShowOnMap
             // 
@@ -162,7 +166,8 @@
             this.comboBoxSelectorMap.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
             this.comboBoxSelectorMap.FormattingEnabled = true;
             this.comboBoxSelectorMap.Items.AddRange(new object[] {
-            "Простая карта", "Карта со стенами"});
+            "Простая карта",
+            "Карта со стенами"});
             this.comboBoxSelectorMap.Location = new System.Drawing.Point(17, 32);
             this.comboBoxSelectorMap.Name = "comboBoxSelectorMap";
             this.comboBoxSelectorMap.Size = new System.Drawing.Size(175, 23);
diff --git a/AirBomber/AirBomber/FormMapWithSetAirplanes.cs b/AirBomber/AirBomber/FormMapWithSetAirplanes.cs
index def5d4e..1b88ac8 100644
--- a/AirBomber/AirBomber/FormMapWithSetAirplanes.cs
+++ b/AirBomber/AirBomber/FormMapWithSetAirplanes.cs
@@ -125,7 +125,7 @@
         /// <param name="e"></param>
         private void ButtonMove_Click(object sender, EventArgs e)
         {
-            if (_mapAirplanesCollectionGeneric == null)
+            if (_mapAirplanesCollectionGeneric == null || !_mapAirplanesCollectionGeneric.Map.HasMap)
             {
                 return;
             }
diff --git a/AirBomber/AirBomber/MapWithSetAirplanesGeneric.cs b/AirBomber/AirBomber/MapWithSetAirplanesGeneric.cs
index 775f1f7..efe2f6c 100644
--- a/AirBomber/AirBomber/MapWithSetAirplanesGeneric.cs
+++ b/AirBomber/AirBomber/MapWithSetAirplanesGeneric.cs
@@ -34,6 +34,9 @@ namespace AirBomber
         /// Карта
         /// </summary>
         private readonly U _map;
+
+        public U Map => _map;
+
         /// <summary>
         /// Конструктор
         /// </summary>
@@ -93,7 +96,7 @@ namespace AirBomber
                 var airplane = _setAirplanes.Get(i);
                 if (airplane != null)
                 {
-                    return _map.CreateMap(_pictureWidth, _pictureHeight, airplane);
+                    return Map.CreateMap(_pictureWidth, _pictureHeight, airplane);
                 }
             }
             return new(_pictureWidth, _pictureHeight);
@@ -105,9 +108,9 @@ namespace AirBomber
         /// <returns></returns>
         public Bitmap MoveObject(Direction direction)
         {
-            if (_map != null)
+            if (Map != null)
             {
-                return _map.MoveObject(direction);
+                return Map.MoveObject(direction);
             }
             return new(_pictureWidth, _pictureHeight);
         }
-- 
2.25.1


From edacc5498e0c375f1c3f38a83e98a7fb6e838421 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=D0=94=D0=B0=D0=BD=D0=B8=D1=8F=D1=80=20=D0=90=D0=B3=D0=BB?=
 =?UTF-8?q?=D0=B8=D1=83=D0=BB=D0=BB=D0=BE=D0=B2?= <danuar228@mail.ru>
Date: Wed, 5 Oct 2022 02:01:24 +0400
Subject: [PATCH 14/14] =?UTF-8?q?=D0=98=D0=B7=D0=BC=D0=B5=D0=BD=D0=B5?=
 =?UTF-8?q?=D0=BD=D0=B8=D1=8F=20=D0=B2=20=D0=BE=D1=82=D1=80=D0=B8=D1=81?=
 =?UTF-8?q?=D0=BE=D0=B2=D0=BA=D0=B5=20=D1=83=D1=87=D0=B0=D1=81=D1=82=D0=BA?=
 =?UTF-8?q?=D0=BE=D0=B2=20=D0=BA=D0=B0=D1=80=D1=82?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

---
 AirBomber/AirBomber/SimpleMap.cs | 4 ++--
 AirBomber/AirBomber/WallMap.cs   | 2 +-
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/AirBomber/AirBomber/SimpleMap.cs b/AirBomber/AirBomber/SimpleMap.cs
index 63bb878..f5f9a69 100644
--- a/AirBomber/AirBomber/SimpleMap.cs
+++ b/AirBomber/AirBomber/SimpleMap.cs
@@ -16,11 +16,11 @@
 
         protected override void DrawBarrierPart(Graphics g, int i, int j)
         {
-            g.FillRectangle(barrierColor, i * _size_x, j * _size_y, i * (_size_x + 1), j * (_size_y + 1));
+            g.FillRectangle(barrierColor, i * _size_x, j * _size_y, _size_x, _size_y);
         }
         protected override void DrawRoadPart(Graphics g, int i, int j)
         {
-            g.FillRectangle(roadColor, i * _size_x, j * _size_y, i * (_size_x + 1), j * (_size_y + 1));
+            g.FillRectangle(roadColor, i * _size_x, j * _size_y, _size_x, _size_y);
         }
         protected override void GenerateMap()
         {
diff --git a/AirBomber/AirBomber/WallMap.cs b/AirBomber/AirBomber/WallMap.cs
index 8cb7989..59273aa 100644
--- a/AirBomber/AirBomber/WallMap.cs
+++ b/AirBomber/AirBomber/WallMap.cs
@@ -31,7 +31,7 @@ namespace AirBomber
 
         protected override void DrawRoadPart(Graphics g, int i, int j)
         {
-            g.FillRectangle(roadColor, i * _size_x, j * _size_y, (i + 1) * _size_x, (j + 1) * _size_y);
+            g.FillRectangle(roadColor, i * _size_x, j * _size_y, _size_x, _size_y);
         }
 
         protected override void GenerateMap()
-- 
2.25.1