From fb0f6def7c06d151474917bc2f9da8a7dc874c1e Mon Sep 17 00:00:00 2001 From: m1aksim1 Date: Fri, 14 Oct 2022 13:17:37 +0400 Subject: [PATCH 1/4] =?UTF-8?q?3=20=D0=BB=D0=B0=D0=B1=D0=B0=20=D0=B4=D0=BE?= =?UTF-8?q?=D0=B1=D0=B0=D0=B2=D0=BB=D0=B5=D0=BD=D0=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- WarPlanes/WarPlanes/Direction.cs | 2 +- WarPlanes/WarPlanes/DrawningWarPlane.cs | 2 +- WarPlanes/WarPlanes/EntityWarPlane.cs | 2 +- WarPlanes/WarPlanes/FormMap.Designer.cs | 207 ----------------- WarPlanes/WarPlanes/FormMap.cs | 93 -------- .../FormMapWithSetWarPlanes.Designer.cs | 217 ++++++++++++++++++ .../WarPlanes/FormMapWithSetWarPlanes.cs | 153 ++++++++++++ ...mMap.resx => FormMapWithSetWarPlanes.resx} | 3 - WarPlanes/WarPlanes/FormWarPlane.Designer.cs | 14 ++ WarPlanes/WarPlanes/FormWarPlane.cs | 35 ++- .../WarPlanes/MapWithSetWarPlanesGeneric.cs | 178 ++++++++++++++ WarPlanes/WarPlanes/Program.cs | 2 +- WarPlanes/WarPlanes/SetWarPlanesGeneric.cs | 87 +++++++ 13 files changed, 684 insertions(+), 311 deletions(-) delete mode 100644 WarPlanes/WarPlanes/FormMap.Designer.cs delete mode 100644 WarPlanes/WarPlanes/FormMap.cs create mode 100644 WarPlanes/WarPlanes/FormMapWithSetWarPlanes.Designer.cs create mode 100644 WarPlanes/WarPlanes/FormMapWithSetWarPlanes.cs rename WarPlanes/WarPlanes/{FormMap.resx => FormMapWithSetWarPlanes.resx} (93%) create mode 100644 WarPlanes/WarPlanes/MapWithSetWarPlanesGeneric.cs create mode 100644 WarPlanes/WarPlanes/SetWarPlanesGeneric.cs diff --git a/WarPlanes/WarPlanes/Direction.cs b/WarPlanes/WarPlanes/Direction.cs index b4de59b..5529c2c 100644 --- a/WarPlanes/WarPlanes/Direction.cs +++ b/WarPlanes/WarPlanes/Direction.cs @@ -3,7 +3,7 @@ /// /// Направление перемещения /// - internal enum Direction + public enum Direction { None = 0, Up = 1, diff --git a/WarPlanes/WarPlanes/DrawningWarPlane.cs b/WarPlanes/WarPlanes/DrawningWarPlane.cs index 5cf40f0..d78ad09 100644 --- a/WarPlanes/WarPlanes/DrawningWarPlane.cs +++ b/WarPlanes/WarPlanes/DrawningWarPlane.cs @@ -3,7 +3,7 @@ /// /// Класс, отвечающий за прорисовку и перемещение объекта-сущности /// - internal class DrawningWarPlane + public class DrawningWarPlane { /// /// Класс-сущность diff --git a/WarPlanes/WarPlanes/EntityWarPlane.cs b/WarPlanes/WarPlanes/EntityWarPlane.cs index c882ddb..5713151 100644 --- a/WarPlanes/WarPlanes/EntityWarPlane.cs +++ b/WarPlanes/WarPlanes/EntityWarPlane.cs @@ -3,7 +3,7 @@ /// /// Класс-сущность "Военный самолёт" /// - internal class EntityWarPlane + public class EntityWarPlane { /// /// Скорость diff --git a/WarPlanes/WarPlanes/FormMap.Designer.cs b/WarPlanes/WarPlanes/FormMap.Designer.cs deleted file mode 100644 index 0995a6e..0000000 --- a/WarPlanes/WarPlanes/FormMap.Designer.cs +++ /dev/null @@ -1,207 +0,0 @@ -namespace WarPlanes -{ - partial class FormMap - { - /// - /// Required designer variable. - /// - private System.ComponentModel.IContainer components = null; - - /// - /// Clean up any resources being used. - /// - /// true if managed resources should be disposed; otherwise, false. - protected override void Dispose(bool disposing) - { - if (disposing && (components != null)) - { - components.Dispose(); - } - base.Dispose(disposing); - } - - #region Windows Form Designer generated code - - /// - /// Required method for Designer support - do not modify - /// the contents of this method with the code editor. - /// - private void InitializeComponent() - { - this.pictureBoxWarPlane = 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.pictureBoxWarPlane)).BeginInit(); - this.statusStrip.SuspendLayout(); - this.SuspendLayout(); - // - // pictureBoxWarPlane - // - this.pictureBoxWarPlane.Dock = System.Windows.Forms.DockStyle.Fill; - this.pictureBoxWarPlane.Location = new System.Drawing.Point(0, 0); - this.pictureBoxWarPlane.Name = "pictureBoxWarPlane"; - this.pictureBoxWarPlane.Size = new System.Drawing.Size(800, 428); - this.pictureBoxWarPlane.SizeMode = System.Windows.Forms.PictureBoxSizeMode.AutoSize; - this.pictureBoxWarPlane.TabIndex = 0; - this.pictureBoxWarPlane.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::WarPlanes.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::WarPlanes.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::WarPlanes.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::WarPlanes.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.pictureBoxWarPlane); - this.Controls.Add(this.statusStrip); - this.Name = "FormMap"; - this.Text = "Карта"; - ((System.ComponentModel.ISupportInitialize)(this.pictureBoxWarPlane)).EndInit(); - this.statusStrip.ResumeLayout(false); - this.statusStrip.PerformLayout(); - this.ResumeLayout(false); - this.PerformLayout(); - - } - - #endregion - - private PictureBox pictureBoxWarPlane; - 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/WarPlanes/WarPlanes/FormMap.cs b/WarPlanes/WarPlanes/FormMap.cs deleted file mode 100644 index b19dd9a..0000000 --- a/WarPlanes/WarPlanes/FormMap.cs +++ /dev/null @@ -1,93 +0,0 @@ -namespace WarPlanes -{ - public partial class FormMap : Form - { - private AbstractMap _abstractMap; - - public FormMap() - { - InitializeComponent(); - _abstractMap = new SimpleMap(); - } - /// - /// Заполнение информации по объекту - /// - /// - private void SetData(DrawningWarPlane warplane) - { - toolStripStatusLabelSpeed.Text = $"Скорость: {warplane.WarPlane.Speed}"; - toolStripStatusLabelWeight.Text = $"Вес: {warplane.WarPlane.Weight}"; - toolStripStatusLabelBodyColor.Text = $"Цвет: {warplane.WarPlane.BodyColor.Name}"; - pictureBoxWarPlane.Image = _abstractMap.CreateMap(pictureBoxWarPlane.Width, pictureBoxWarPlane.Height, new DrawningObjectWarPlane(warplane)); - } - /// - /// Обработка нажатия кнопки "Создать" - /// - /// - /// - private void ButtonCreate_Click(object sender, EventArgs e) - { - Random rnd = new(); - var warplane = new DrawningWarPlane(rnd.Next(100, 300), rnd.Next(1000, 2000), Color.FromArgb(rnd.Next(0, 256), rnd.Next(0, 256), rnd.Next(0, 256))); - SetData(warplane); - } - /// - /// Изменение размеров формы - /// - /// - /// - 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; - } - pictureBoxWarPlane.Image = _abstractMap?.MoveObject(dir); - } - /// - /// Обработка нажатия кнопки "Модификация" - /// - /// - /// - private void ButtonCreateModif_Click(object sender, EventArgs e) - { - Random rnd = new(); - var fighter = new DrawningFighter(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(fighter); - } - /// - /// Смена карты - /// - /// - /// - private void ComboBoxSelectorMap_SelectedIndexChanged(object sender, EventArgs e) - { - switch (comboBoxSelectorMap.Text) - { - case "Простая карта": - _abstractMap = new SimpleMap(); - break; - case "Закрытая карта": - _abstractMap = new CloseMap(); - break; - } - } - } -} diff --git a/WarPlanes/WarPlanes/FormMapWithSetWarPlanes.Designer.cs b/WarPlanes/WarPlanes/FormMapWithSetWarPlanes.Designer.cs new file mode 100644 index 0000000..267ecab --- /dev/null +++ b/WarPlanes/WarPlanes/FormMapWithSetWarPlanes.Designer.cs @@ -0,0 +1,217 @@ +namespace WarPlanes +{ + partial class FormMapWithSetWarPlanes + { + /// + /// Required designer variable. + /// + private System.ComponentModel.IContainer components = null; + + /// + /// Clean up any resources being used. + /// + /// true if managed resources should be disposed; otherwise, false. + protected override void Dispose(bool disposing) + { + if (disposing && (components != null)) + { + components.Dispose(); + } + base.Dispose(disposing); + } + + #region Windows Form Designer generated code + + /// + /// Required method for Designer support - do not modify + /// the contents of this method with the code editor. + /// + private void InitializeComponent() + { + this.groupBoxTools = new System.Windows.Forms.GroupBox(); + this.maskedTextBoxPosition = new System.Windows.Forms.MaskedTextBox(); + this.buttonRemoveWarPlane = 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.buttonAddWarPlane = 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.buttonRemoveWarPlane); + 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.buttonAddWarPlane); + 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); + // + // buttonRemoveWarPlane + // + this.buttonRemoveWarPlane.Location = new System.Drawing.Point(17, 195); + this.buttonRemoveWarPlane.Name = "buttonRemoveWarPlane"; + this.buttonRemoveWarPlane.Size = new System.Drawing.Size(175, 35); + this.buttonRemoveWarPlane.TabIndex = 3; + this.buttonRemoveWarPlane.Text = "Удалить самолёт"; + this.buttonRemoveWarPlane.UseVisualStyleBackColor = true; + this.buttonRemoveWarPlane.Click += new System.EventHandler(this.ButtonRemoveWarPlane_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::WarPlanes.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; + this.buttonDown.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::WarPlanes.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; + this.buttonRight.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::WarPlanes.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; + this.buttonLeft.Click += new System.EventHandler(this.ButtonMove_Click); + // + // buttonUp + // + this.buttonUp.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); + this.buttonUp.BackgroundImage = global::WarPlanes.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; + this.buttonUp.Click += new System.EventHandler(this.ButtonMove_Click); + // + // 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); + // + // buttonAddWarPlane + // + this.buttonAddWarPlane.Location = new System.Drawing.Point(17, 106); + this.buttonAddWarPlane.Name = "buttonAddWarPlane"; + this.buttonAddWarPlane.Size = new System.Drawing.Size(175, 35); + this.buttonAddWarPlane.TabIndex = 1; + this.buttonAddWarPlane.Text = "Добавить самолёт"; + this.buttonAddWarPlane.UseVisualStyleBackColor = true; + this.buttonAddWarPlane.Click += new System.EventHandler(this.ButtonAddWarPlane_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; + // + // FormMapWithSetWarPlanes + // + 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 = "FormMapWithSetWarPlanes"; + 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 buttonAddWarPlane; + private Button buttonDown; + private Button buttonRight; + private Button buttonLeft; + private Button buttonUp; + private Button buttonShowStorage; + private Button buttonRemoveWarPlane; + private MaskedTextBox maskedTextBoxPosition; + } +} \ No newline at end of file diff --git a/WarPlanes/WarPlanes/FormMapWithSetWarPlanes.cs b/WarPlanes/WarPlanes/FormMapWithSetWarPlanes.cs new file mode 100644 index 0000000..3c4d24e --- /dev/null +++ b/WarPlanes/WarPlanes/FormMapWithSetWarPlanes.cs @@ -0,0 +1,153 @@ +namespace WarPlanes +{ + public partial class FormMapWithSetWarPlanes : Form + { + /// + /// Объект от класса карты с набором объектов + /// + private MapWithSetWarPlanesGeneric _mapWarPlanesCollectionGeneric; + /// + /// Конструктор + /// + public FormMapWithSetWarPlanes() + { + InitializeComponent(); + } + /// + /// Выбор карты + /// + /// + /// + private void ComboBoxSelectorMap_SelectedIndexChanged(object sender, EventArgs e) + { + AbstractMap map = null; + switch (comboBoxSelectorMap.Text) + { + case "Простая карта": + map = new SimpleMap(); + break; + case "Закрытая карта": + map = new CloseMap(); + break; + } + if (map != null) + { + _mapWarPlanesCollectionGeneric = new MapWithSetWarPlanesGeneric( + pictureBox.Width, pictureBox.Height, map); + } + else + { + _mapWarPlanesCollectionGeneric = null; + } + } + /// + /// Добавление объекта + /// + /// + /// + private void ButtonAddWarPlane_Click(object sender, EventArgs e) + { + if(_mapWarPlanesCollectionGeneric == null) + { + return; + } + FormWarPlane form = new(); + if (form.ShowDialog() == DialogResult.OK) + { + DrawningObjectWarPlane warplane = new(form.SelectedWarPlane); + if (form.SelectedWarPlane == null || (_mapWarPlanesCollectionGeneric + warplane) == -1) + { + MessageBox.Show("Не удалось добавить объект"); + } + else + { + MessageBox.Show("Объект добавлен"); + pictureBox.Image = _mapWarPlanesCollectionGeneric.ShowSet(); + } + } + } + /// + /// Удаление объекта + /// + /// + /// + private void ButtonRemoveWarPlane_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 (_mapWarPlanesCollectionGeneric - pos != null) + { + MessageBox.Show("Объект удален"); + pictureBox.Image = _mapWarPlanesCollectionGeneric.ShowSet(); + } + else + { + MessageBox.Show("Не удалось удалить объект"); + } + } + /// + /// Вывод набора + /// + /// + /// + private void ButtonShowStorage_Click(object sender, EventArgs e) + { + if (_mapWarPlanesCollectionGeneric == null) + { + return; + } + pictureBox.Image = _mapWarPlanesCollectionGeneric.ShowSet(); + } + /// + /// Вывод карты + /// + /// + /// + private void ButtonShowOnMap_Click(object sender, EventArgs e) + { + if (_mapWarPlanesCollectionGeneric == null) + { + return; + } + pictureBox.Image = _mapWarPlanesCollectionGeneric.ShowOnMap(); + } + /// + /// Перемещение + /// + /// + /// + private void ButtonMove_Click(object sender, EventArgs e) + { + if (_mapWarPlanesCollectionGeneric == 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 = _mapWarPlanesCollectionGeneric.MoveObject(dir); + } + } +} \ No newline at end of file diff --git a/WarPlanes/WarPlanes/FormMap.resx b/WarPlanes/WarPlanes/FormMapWithSetWarPlanes.resx similarity index 93% rename from WarPlanes/WarPlanes/FormMap.resx rename to WarPlanes/WarPlanes/FormMapWithSetWarPlanes.resx index 2c0949d..f298a7b 100644 --- a/WarPlanes/WarPlanes/FormMap.resx +++ b/WarPlanes/WarPlanes/FormMapWithSetWarPlanes.resx @@ -57,7 +57,4 @@ System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - 17, 17 - \ No newline at end of file diff --git a/WarPlanes/WarPlanes/FormWarPlane.Designer.cs b/WarPlanes/WarPlanes/FormWarPlane.Designer.cs index 068fbf7..486bbed 100644 --- a/WarPlanes/WarPlanes/FormWarPlane.Designer.cs +++ b/WarPlanes/WarPlanes/FormWarPlane.Designer.cs @@ -39,6 +39,7 @@ this.toolStripStatusLabelWeight = new System.Windows.Forms.ToolStripStatusLabel(); this.toolStripStatusLabelBodyColor = new System.Windows.Forms.ToolStripStatusLabel(); this.buttonCreateModif = new System.Windows.Forms.Button(); + this.buttonSelectCar = new System.Windows.Forms.Button(); ((System.ComponentModel.ISupportInitialize)(this.pictureBoxWarPlane)).BeginInit(); this.statusStrip.SuspendLayout(); this.SuspendLayout(); @@ -152,11 +153,23 @@ this.buttonCreateModif.UseVisualStyleBackColor = true; this.buttonCreateModif.Click += new System.EventHandler(this.ButtonCreateModif_Click); // + // buttonSelectCar + // + this.buttonSelectCar.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left))); + this.buttonSelectCar.Location = new System.Drawing.Point(569, 390); + this.buttonSelectCar.Name = "buttonSelectCar"; + this.buttonSelectCar.Size = new System.Drawing.Size(75, 23); + this.buttonSelectCar.TabIndex = 15; + this.buttonSelectCar.Text = "Выбрать"; + this.buttonSelectCar.UseVisualStyleBackColor = true; + this.buttonSelectCar.Click += new System.EventHandler(this.ButtonSelectWarPlane_Click); + // // FormWarPlane // 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.buttonSelectCar); this.Controls.Add(this.buttonCreateModif); this.Controls.Add(this.buttonDown); this.Controls.Add(this.buttonRight); @@ -188,5 +201,6 @@ private ToolStripStatusLabel toolStripStatusLabelWeight; private ToolStripStatusLabel toolStripStatusLabelBodyColor; private Button buttonCreateModif; + private Button buttonSelectCar; } } \ No newline at end of file diff --git a/WarPlanes/WarPlanes/FormWarPlane.cs b/WarPlanes/WarPlanes/FormWarPlane.cs index d1de930..7b6682b 100644 --- a/WarPlanes/WarPlanes/FormWarPlane.cs +++ b/WarPlanes/WarPlanes/FormWarPlane.cs @@ -3,6 +3,10 @@ namespace WarPlanes public partial class FormWarPlane : Form { private DrawningWarPlane _warplane; + /// + /// + /// + public DrawningWarPlane SelectedWarPlane { get; private set; } public FormWarPlane() { @@ -37,7 +41,13 @@ namespace WarPlanes private void ButtonCreate_Click(object sender, EventArgs e) { Random rnd = new(); - _warplane = new DrawningWarPlane(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; + } + _warplane = new DrawningWarPlane(rnd.Next(100, 300), rnd.Next(1000, 2000), color); SetData(); Draw(); } @@ -85,12 +95,29 @@ namespace WarPlanes private void ButtonCreateModif_Click(object sender, EventArgs e) { Random rnd = new(); - _warplane = new DrawningFighter(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; + } + _warplane = new DrawningFighter(rnd.Next(100, 300), rnd.Next(1000, 2000), color, dopColor, Convert.ToBoolean(rnd.Next(0, 2)), Convert.ToBoolean(rnd.Next(0, 2))); + SetData(); Draw(); } + + private void ButtonSelectWarPlane_Click(object sender, EventArgs e) + { + SelectedWarPlane = _warplane; + DialogResult = DialogResult.OK; + } } } \ No newline at end of file diff --git a/WarPlanes/WarPlanes/MapWithSetWarPlanesGeneric.cs b/WarPlanes/WarPlanes/MapWithSetWarPlanesGeneric.cs new file mode 100644 index 0000000..f933dc2 --- /dev/null +++ b/WarPlanes/WarPlanes/MapWithSetWarPlanesGeneric.cs @@ -0,0 +1,178 @@ +namespace WarPlanes +{ + /// + /// Карта с набром объектов под нее + /// + /// + /// + internal class MapWithSetWarPlanesGeneric + where T : class, IDrawningObject + where U : AbstractMap + { + /// + /// Ширина окна отрисовки + /// + private readonly int _pictureWidth; + /// + /// Высота окна отрисовки + /// + private readonly int _pictureHeight; + /// + /// Размер занимаемого объектом места (ширина) + /// + private readonly int _placeSizeWidth = 210; + /// + /// Размер занимаемого объектом места (высота) + /// + private readonly int _placeSizeHeight = 90; + /// + /// Набор объектов + /// + private readonly SetWarPlanesGeneric _setWarPlanes; + /// + /// Карта + /// + private readonly U _map; + /// + /// Конструктор + /// + /// + /// + /// + public MapWithSetWarPlanesGeneric(int picWidth, int picHeight, U map) + { + int width = picWidth / _placeSizeWidth; + int height = picHeight / _placeSizeHeight; + _setWarPlanes = new SetWarPlanesGeneric(width * height); + _pictureWidth = picWidth; + _pictureHeight = picHeight; + _map = map; + } + /// + /// Перегрузка оператора сложения + /// + /// + /// + /// + public static int operator +(MapWithSetWarPlanesGeneric map, T warplane) + { + return map._setWarPlanes.Insert(warplane); + } + /// + /// Перегрузка оператора вычитания + /// + /// + /// + /// + public static T operator -(MapWithSetWarPlanesGeneric map, int position) + { + return map._setWarPlanes.Remove(position); + } + /// + /// Вывод всего набора объектов + /// + /// + public Bitmap ShowSet() + { + Bitmap bmp = new(_pictureWidth, _pictureHeight); + Graphics gr = Graphics.FromImage(bmp); + DrawBackground(gr); + DrawWarPlanes(gr); + return bmp; + } + /// + /// Просмотр объекта на карте + /// + /// + public Bitmap ShowOnMap() + { + Shaking(); + for (int i = 0; i < _setWarPlanes.Count; i++) + { + var warplane = _setWarPlanes.Get(i); + if (warplane != null) + { + return _map.CreateMap(_pictureWidth, _pictureHeight, warplane); + } + } + return new(_pictureWidth, _pictureHeight); + } + /// + /// Перемещение объекта по крате + /// + /// + /// + public Bitmap MoveObject(Direction direction) + { + if (_map != null) + { + return _map.MoveObject(direction); + } + return new(_pictureWidth, _pictureHeight); + } + /// + /// "Взбалтываем" набор, чтобы все элементы оказались в начале + /// + private void Shaking() + { + int j = _setWarPlanes.Count - 1; + for (int i = 0; i < _setWarPlanes.Count; i++) + { + if (_setWarPlanes.Get(i) == null) + { + for (; j > i; j--) + { + var warplane = _setWarPlanes.Get(j); + if (warplane != null) + { + _setWarPlanes.Insert(warplane, i); + _setWarPlanes.Remove(j); + break; + } + } + if (j <= i) + { + return; + } + } + } + } + private void DrawHangar(Graphics g, int x, int y, int width, int height) + { + Pen pen = new(Color.Black, 3); + g.DrawLine(pen, x, y, x + width, y); + g.DrawLine(pen, x, y, x, y+height); + g.DrawLine(pen, x, y + height, x+ width, y + height); + } + /// + /// Метод отрисовки фона + /// + /// + private void DrawBackground(Graphics g) + { + + for (int i = 0; i < _pictureWidth / _placeSizeWidth; i++) + { + for (int j = 0; j < _pictureHeight / _placeSizeHeight + 1; ++j) + { + DrawHangar(g, i * _placeSizeWidth, j * _placeSizeHeight, _placeSizeWidth*3/4, _placeSizeHeight-10); + } + } + } + /// + /// Метод прорисовки объектов + /// + /// + private void DrawWarPlanes(Graphics g) + { + int countInLine = _pictureWidth / _placeSizeWidth; + int maxLeft = (countInLine - 1) * _placeSizeWidth; + for (int i = 0; i < _setWarPlanes.Count; i++) + { + var airplane = _setWarPlanes.Get(i); + airplane?.SetObject(maxLeft - i % countInLine * _placeSizeWidth +10, _pictureHeight - _placeSizeHeight - i / countInLine * _placeSizeHeight, _pictureWidth, _pictureHeight); + airplane?.DrawningObject(g); + } + } + } +} \ No newline at end of file diff --git a/WarPlanes/WarPlanes/Program.cs b/WarPlanes/WarPlanes/Program.cs index 21241cc..6236a91 100644 --- a/WarPlanes/WarPlanes/Program.cs +++ b/WarPlanes/WarPlanes/Program.cs @@ -11,7 +11,7 @@ namespace WarPlanes // 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 FormMapWithSetWarPlanes()); } } } \ No newline at end of file diff --git a/WarPlanes/WarPlanes/SetWarPlanesGeneric.cs b/WarPlanes/WarPlanes/SetWarPlanesGeneric.cs new file mode 100644 index 0000000..25d0707 --- /dev/null +++ b/WarPlanes/WarPlanes/SetWarPlanesGeneric.cs @@ -0,0 +1,87 @@ +namespace WarPlanes +{ + /// + /// Параметризованный набор объектов + /// + /// + internal class SetWarPlanesGeneric + where T : class + { + /// + /// Массив объектов, которые храним + /// + private readonly T[] _places; + /// + /// Количество объектов в массиве + /// + public int Count => _places.Length; + /// + /// Конструктор + /// + /// + public SetWarPlanesGeneric(int count) + { + _places = new T[count]; + } + /// + /// Добавление объекта в набор + /// + /// Добавляемый самолёт + /// + public int Insert(T warplane) + { + return Insert(warplane, 0); + } + private bool isCorrectPosition(int position) + { + return 0 <= position && position < Count; + } + /// + /// Добавление объекта в набор на конкретную позицию + /// + /// Добавляемый военный самолёт + /// Позиция + /// + public int Insert(T warplane, int position) + { + int positionNullElement = position; + while (Get(positionNullElement) != null) + { + positionNullElement++; + } + if (!isCorrectPosition(positionNullElement)) + { + return -1; + } + while (positionNullElement != position) // Смещение вправо + { + _places[positionNullElement] = _places[positionNullElement - 1]; + positionNullElement--; + } + _places[position] = warplane; + return position; + } + /// + /// Удаление объекта из набора с конкретной позиции + /// + /// + /// + public T Remove(int position) + { + if (!isCorrectPosition(position)) return null; + var result = _places[position]; + _places[position] = null; + return result; + } + /// + /// Получение объекта из набора по позиции + /// + /// + /// + public T Get(int position) + { + if (isCorrectPosition(position)) { return _places[position]; } + else { return null; } + } + } +} \ No newline at end of file From 0039840d33f9fabe68442b6e8c74e0f2e7f3d60f Mon Sep 17 00:00:00 2001 From: m1aksim1 Date: Fri, 14 Oct 2022 13:33:18 +0400 Subject: [PATCH 2/4] =?UTF-8?q?=D0=BF=D0=B5=D1=80=D0=B5=D0=BC=D0=B5=D0=B8?= =?UTF-8?q?=D0=BD=D0=BE=D0=B2=D0=B0=D0=BD=D0=B8=D0=B5=20=D0=BF=D1=80=D0=BE?= =?UTF-8?q?=D0=B5=D0=BA=D1=82=D0=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- WarPlanes/{WarPlanes.sln => AirFighter.sln} | 2 +- WarPlanes/WarPlanes/AbstractMap.cs | 2 +- .../WarPlanes/{WarPlanes.csproj => AirFighter.csproj} | 0 WarPlanes/WarPlanes/Direction.cs | 2 +- WarPlanes/WarPlanes/DrawningFighter.cs | 2 +- WarPlanes/WarPlanes/DrawningObjectWarPlane.cs | 2 +- WarPlanes/WarPlanes/DrawningWarPlane.cs | 2 +- WarPlanes/WarPlanes/EntityFighter.cs | 2 +- WarPlanes/WarPlanes/EntityWarPlane.cs | 2 +- WarPlanes/WarPlanes/FormWarPlane.Designer.cs | 10 +++++----- WarPlanes/WarPlanes/FormWarPlane.cs | 2 +- WarPlanes/WarPlanes/IDrawningObject.cs | 2 +- WarPlanes/WarPlanes/Program.cs | 2 +- WarPlanes/WarPlanes/Properties/Resources.Designer.cs | 4 ++-- WarPlanes/WarPlanes/SimpleMap.cs | 2 +- WarPlanes/WarPlanes/СloseMap.cs | 2 +- 16 files changed, 20 insertions(+), 20 deletions(-) rename WarPlanes/{WarPlanes.sln => AirFighter.sln} (87%) rename WarPlanes/WarPlanes/{WarPlanes.csproj => AirFighter.csproj} (100%) diff --git a/WarPlanes/WarPlanes.sln b/WarPlanes/AirFighter.sln similarity index 87% rename from WarPlanes/WarPlanes.sln rename to WarPlanes/AirFighter.sln index 48f9a9e..12efab8 100644 --- a/WarPlanes/WarPlanes.sln +++ b/WarPlanes/AirFighter.sln @@ -3,7 +3,7 @@ Microsoft Visual Studio Solution File, Format Version 12.00 # Visual Studio Version 17 VisualStudioVersion = 17.2.32526.322 MinimumVisualStudioVersion = 10.0.40219.1 -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "WarPlanes", "WarPlanes\WarPlanes.csproj", "{73B34668-A34C-4E60-8961-BFBAF2BCEE88}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "AirFighter", "WarPlanes\AirFighter.csproj", "{73B34668-A34C-4E60-8961-BFBAF2BCEE88}" EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution diff --git a/WarPlanes/WarPlanes/AbstractMap.cs b/WarPlanes/WarPlanes/AbstractMap.cs index a9a4765..90f92b0 100644 --- a/WarPlanes/WarPlanes/AbstractMap.cs +++ b/WarPlanes/WarPlanes/AbstractMap.cs @@ -4,7 +4,7 @@ using System.Linq; using System.Text; using System.Threading.Tasks; -namespace WarPlanes +namespace AirFighter { internal abstract class AbstractMap { diff --git a/WarPlanes/WarPlanes/WarPlanes.csproj b/WarPlanes/WarPlanes/AirFighter.csproj similarity index 100% rename from WarPlanes/WarPlanes/WarPlanes.csproj rename to WarPlanes/WarPlanes/AirFighter.csproj diff --git a/WarPlanes/WarPlanes/Direction.cs b/WarPlanes/WarPlanes/Direction.cs index 5529c2c..a43a18c 100644 --- a/WarPlanes/WarPlanes/Direction.cs +++ b/WarPlanes/WarPlanes/Direction.cs @@ -1,4 +1,4 @@ -namespace WarPlanes +namespace AirFighter { /// /// Направление перемещения diff --git a/WarPlanes/WarPlanes/DrawningFighter.cs b/WarPlanes/WarPlanes/DrawningFighter.cs index 1aba474..4974d15 100644 --- a/WarPlanes/WarPlanes/DrawningFighter.cs +++ b/WarPlanes/WarPlanes/DrawningFighter.cs @@ -1,4 +1,4 @@ -namespace WarPlanes +namespace AirFighter { internal class DrawningFighter : DrawningWarPlane { diff --git a/WarPlanes/WarPlanes/DrawningObjectWarPlane.cs b/WarPlanes/WarPlanes/DrawningObjectWarPlane.cs index 6af1850..c8e2c7d 100644 --- a/WarPlanes/WarPlanes/DrawningObjectWarPlane.cs +++ b/WarPlanes/WarPlanes/DrawningObjectWarPlane.cs @@ -1,4 +1,4 @@ -namespace WarPlanes +namespace AirFighter { internal class DrawningObjectWarPlane : IDrawningObject { diff --git a/WarPlanes/WarPlanes/DrawningWarPlane.cs b/WarPlanes/WarPlanes/DrawningWarPlane.cs index d78ad09..d05e9c4 100644 --- a/WarPlanes/WarPlanes/DrawningWarPlane.cs +++ b/WarPlanes/WarPlanes/DrawningWarPlane.cs @@ -1,4 +1,4 @@ -namespace WarPlanes +namespace AirFighter { /// /// Класс, отвечающий за прорисовку и перемещение объекта-сущности diff --git a/WarPlanes/WarPlanes/EntityFighter.cs b/WarPlanes/WarPlanes/EntityFighter.cs index 3f0b316..c77b46b 100644 --- a/WarPlanes/WarPlanes/EntityFighter.cs +++ b/WarPlanes/WarPlanes/EntityFighter.cs @@ -1,4 +1,4 @@ -namespace WarPlanes +namespace AirFighter { /// /// Класс-сущность "Истрибитель" diff --git a/WarPlanes/WarPlanes/EntityWarPlane.cs b/WarPlanes/WarPlanes/EntityWarPlane.cs index 5713151..941dc1a 100644 --- a/WarPlanes/WarPlanes/EntityWarPlane.cs +++ b/WarPlanes/WarPlanes/EntityWarPlane.cs @@ -1,4 +1,4 @@ -namespace WarPlanes +namespace AirFighter { /// /// Класс-сущность "Военный самолёт" diff --git a/WarPlanes/WarPlanes/FormWarPlane.Designer.cs b/WarPlanes/WarPlanes/FormWarPlane.Designer.cs index 486bbed..89a83cb 100644 --- a/WarPlanes/WarPlanes/FormWarPlane.Designer.cs +++ b/WarPlanes/WarPlanes/FormWarPlane.Designer.cs @@ -1,4 +1,4 @@ -namespace WarPlanes +namespace AirFighter { partial class FormWarPlane { @@ -47,7 +47,7 @@ // buttonDown // this.buttonDown.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); - this.buttonDown.BackgroundImage = global::WarPlanes.Properties.Resources.arrowDown; + this.buttonDown.BackgroundImage = global::AirFighter.Properties.Resources.arrowDown; this.buttonDown.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Stretch; this.buttonDown.Location = new System.Drawing.Point(722, 386); this.buttonDown.Name = "buttonDown"; @@ -59,7 +59,7 @@ // buttonRight // this.buttonRight.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); - this.buttonRight.BackgroundImage = global::WarPlanes.Properties.Resources.arrowRight; + this.buttonRight.BackgroundImage = global::AirFighter.Properties.Resources.arrowRight; this.buttonRight.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Stretch; this.buttonRight.Location = new System.Drawing.Point(758, 386); this.buttonRight.Name = "buttonRight"; @@ -71,7 +71,7 @@ // buttonLeft // this.buttonLeft.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); - this.buttonLeft.BackgroundImage = global::WarPlanes.Properties.Resources.arrowLeft; + this.buttonLeft.BackgroundImage = global::AirFighter.Properties.Resources.arrowLeft; this.buttonLeft.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Stretch; this.buttonLeft.Location = new System.Drawing.Point(686, 386); this.buttonLeft.Name = "buttonLeft"; @@ -83,7 +83,7 @@ // buttonUp // this.buttonUp.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); - this.buttonUp.BackgroundImage = global::WarPlanes.Properties.Resources.arrowUp; + this.buttonUp.BackgroundImage = global::AirFighter.Properties.Resources.arrowUp; this.buttonUp.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Stretch; this.buttonUp.Location = new System.Drawing.Point(722, 350); this.buttonUp.Name = "buttonUp"; diff --git a/WarPlanes/WarPlanes/FormWarPlane.cs b/WarPlanes/WarPlanes/FormWarPlane.cs index 7b6682b..5e6c347 100644 --- a/WarPlanes/WarPlanes/FormWarPlane.cs +++ b/WarPlanes/WarPlanes/FormWarPlane.cs @@ -1,4 +1,4 @@ -namespace WarPlanes +namespace AirFighter { public partial class FormWarPlane : Form { diff --git a/WarPlanes/WarPlanes/IDrawningObject.cs b/WarPlanes/WarPlanes/IDrawningObject.cs index 8002336..3d6457c 100644 --- a/WarPlanes/WarPlanes/IDrawningObject.cs +++ b/WarPlanes/WarPlanes/IDrawningObject.cs @@ -1,4 +1,4 @@ -namespace WarPlanes +namespace AirFighter { internal interface IDrawningObject { diff --git a/WarPlanes/WarPlanes/Program.cs b/WarPlanes/WarPlanes/Program.cs index 6236a91..70f3587 100644 --- a/WarPlanes/WarPlanes/Program.cs +++ b/WarPlanes/WarPlanes/Program.cs @@ -1,4 +1,4 @@ -namespace WarPlanes +namespace AirFighter { internal static class Program { diff --git a/WarPlanes/WarPlanes/Properties/Resources.Designer.cs b/WarPlanes/WarPlanes/Properties/Resources.Designer.cs index bb2583b..657b5a0 100644 --- a/WarPlanes/WarPlanes/Properties/Resources.Designer.cs +++ b/WarPlanes/WarPlanes/Properties/Resources.Designer.cs @@ -8,7 +8,7 @@ // //------------------------------------------------------------------------------ -namespace WarPlanes.Properties { +namespace AirFighter.Properties { using System; @@ -39,7 +39,7 @@ namespace WarPlanes.Properties { internal static global::System.Resources.ResourceManager ResourceManager { get { if (object.ReferenceEquals(resourceMan, null)) { - global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("WarPlanes.Properties.Resources", typeof(Resources).Assembly); + global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("AirFighter.Properties.Resources", typeof(Resources).Assembly); resourceMan = temp; } return resourceMan; diff --git a/WarPlanes/WarPlanes/SimpleMap.cs b/WarPlanes/WarPlanes/SimpleMap.cs index 1e26bca..7529e0c 100644 --- a/WarPlanes/WarPlanes/SimpleMap.cs +++ b/WarPlanes/WarPlanes/SimpleMap.cs @@ -1,4 +1,4 @@ -namespace WarPlanes +namespace AirFighter { /// /// Простая реализация абсрактного класса AbstractMap diff --git a/WarPlanes/WarPlanes/СloseMap.cs b/WarPlanes/WarPlanes/СloseMap.cs index fef90cc..83e09b2 100644 --- a/WarPlanes/WarPlanes/СloseMap.cs +++ b/WarPlanes/WarPlanes/СloseMap.cs @@ -1,4 +1,4 @@ -namespace WarPlanes +namespace AirFighter { /// /// Простая реализация абсрактного класса AbstractMap From 57503df640deb144f574ca1cc90b7e14e337ffb0 Mon Sep 17 00:00:00 2001 From: m1aksim1 Date: Fri, 14 Oct 2022 13:33:18 +0400 Subject: [PATCH 3/4] =?UTF-8?q?=D0=BF=D0=B5=D1=80=D0=B5=D0=BC=D0=B5=D0=B8?= =?UTF-8?q?=D0=BD=D0=BE=D0=B2=D0=B0=D0=BD=D0=B8=D0=B5=20=D0=BF=D1=80=D0=BE?= =?UTF-8?q?=D0=B5=D0=BA=D1=82=D0=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- WarPlanes/{WarPlanes.sln => AirFighter.sln} | 2 +- WarPlanes/WarPlanes/AbstractMap.cs | 2 +- .../WarPlanes/{WarPlanes.csproj => AirFighter.csproj} | 0 WarPlanes/WarPlanes/Direction.cs | 2 +- WarPlanes/WarPlanes/DrawningFighter.cs | 2 +- WarPlanes/WarPlanes/DrawningObjectWarPlane.cs | 2 +- WarPlanes/WarPlanes/DrawningWarPlane.cs | 2 +- WarPlanes/WarPlanes/EntityFighter.cs | 2 +- WarPlanes/WarPlanes/EntityWarPlane.cs | 2 +- .../WarPlanes/FormMapWithSetWarPlanes.Designer.cs | 10 +++++----- WarPlanes/WarPlanes/FormMapWithSetWarPlanes.cs | 2 +- WarPlanes/WarPlanes/FormWarPlane.Designer.cs | 10 +++++----- WarPlanes/WarPlanes/FormWarPlane.cs | 2 +- WarPlanes/WarPlanes/IDrawningObject.cs | 2 +- WarPlanes/WarPlanes/MapWithSetWarPlanesGeneric.cs | 2 +- WarPlanes/WarPlanes/Program.cs | 2 +- WarPlanes/WarPlanes/Properties/Resources.Designer.cs | 4 ++-- WarPlanes/WarPlanes/SetWarPlanesGeneric.cs | 2 +- WarPlanes/WarPlanes/SimpleMap.cs | 2 +- WarPlanes/WarPlanes/СloseMap.cs | 2 +- 20 files changed, 28 insertions(+), 28 deletions(-) rename WarPlanes/{WarPlanes.sln => AirFighter.sln} (87%) rename WarPlanes/WarPlanes/{WarPlanes.csproj => AirFighter.csproj} (100%) diff --git a/WarPlanes/WarPlanes.sln b/WarPlanes/AirFighter.sln similarity index 87% rename from WarPlanes/WarPlanes.sln rename to WarPlanes/AirFighter.sln index 48f9a9e..12efab8 100644 --- a/WarPlanes/WarPlanes.sln +++ b/WarPlanes/AirFighter.sln @@ -3,7 +3,7 @@ Microsoft Visual Studio Solution File, Format Version 12.00 # Visual Studio Version 17 VisualStudioVersion = 17.2.32526.322 MinimumVisualStudioVersion = 10.0.40219.1 -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "WarPlanes", "WarPlanes\WarPlanes.csproj", "{73B34668-A34C-4E60-8961-BFBAF2BCEE88}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "AirFighter", "WarPlanes\AirFighter.csproj", "{73B34668-A34C-4E60-8961-BFBAF2BCEE88}" EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution diff --git a/WarPlanes/WarPlanes/AbstractMap.cs b/WarPlanes/WarPlanes/AbstractMap.cs index a9a4765..90f92b0 100644 --- a/WarPlanes/WarPlanes/AbstractMap.cs +++ b/WarPlanes/WarPlanes/AbstractMap.cs @@ -4,7 +4,7 @@ using System.Linq; using System.Text; using System.Threading.Tasks; -namespace WarPlanes +namespace AirFighter { internal abstract class AbstractMap { diff --git a/WarPlanes/WarPlanes/WarPlanes.csproj b/WarPlanes/WarPlanes/AirFighter.csproj similarity index 100% rename from WarPlanes/WarPlanes/WarPlanes.csproj rename to WarPlanes/WarPlanes/AirFighter.csproj diff --git a/WarPlanes/WarPlanes/Direction.cs b/WarPlanes/WarPlanes/Direction.cs index 5529c2c..a43a18c 100644 --- a/WarPlanes/WarPlanes/Direction.cs +++ b/WarPlanes/WarPlanes/Direction.cs @@ -1,4 +1,4 @@ -namespace WarPlanes +namespace AirFighter { /// /// Направление перемещения diff --git a/WarPlanes/WarPlanes/DrawningFighter.cs b/WarPlanes/WarPlanes/DrawningFighter.cs index 1aba474..4974d15 100644 --- a/WarPlanes/WarPlanes/DrawningFighter.cs +++ b/WarPlanes/WarPlanes/DrawningFighter.cs @@ -1,4 +1,4 @@ -namespace WarPlanes +namespace AirFighter { internal class DrawningFighter : DrawningWarPlane { diff --git a/WarPlanes/WarPlanes/DrawningObjectWarPlane.cs b/WarPlanes/WarPlanes/DrawningObjectWarPlane.cs index 6af1850..c8e2c7d 100644 --- a/WarPlanes/WarPlanes/DrawningObjectWarPlane.cs +++ b/WarPlanes/WarPlanes/DrawningObjectWarPlane.cs @@ -1,4 +1,4 @@ -namespace WarPlanes +namespace AirFighter { internal class DrawningObjectWarPlane : IDrawningObject { diff --git a/WarPlanes/WarPlanes/DrawningWarPlane.cs b/WarPlanes/WarPlanes/DrawningWarPlane.cs index d78ad09..d05e9c4 100644 --- a/WarPlanes/WarPlanes/DrawningWarPlane.cs +++ b/WarPlanes/WarPlanes/DrawningWarPlane.cs @@ -1,4 +1,4 @@ -namespace WarPlanes +namespace AirFighter { /// /// Класс, отвечающий за прорисовку и перемещение объекта-сущности diff --git a/WarPlanes/WarPlanes/EntityFighter.cs b/WarPlanes/WarPlanes/EntityFighter.cs index 3f0b316..c77b46b 100644 --- a/WarPlanes/WarPlanes/EntityFighter.cs +++ b/WarPlanes/WarPlanes/EntityFighter.cs @@ -1,4 +1,4 @@ -namespace WarPlanes +namespace AirFighter { /// /// Класс-сущность "Истрибитель" diff --git a/WarPlanes/WarPlanes/EntityWarPlane.cs b/WarPlanes/WarPlanes/EntityWarPlane.cs index 5713151..941dc1a 100644 --- a/WarPlanes/WarPlanes/EntityWarPlane.cs +++ b/WarPlanes/WarPlanes/EntityWarPlane.cs @@ -1,4 +1,4 @@ -namespace WarPlanes +namespace AirFighter { /// /// Класс-сущность "Военный самолёт" diff --git a/WarPlanes/WarPlanes/FormMapWithSetWarPlanes.Designer.cs b/WarPlanes/WarPlanes/FormMapWithSetWarPlanes.Designer.cs index 267ecab..888b39e 100644 --- a/WarPlanes/WarPlanes/FormMapWithSetWarPlanes.Designer.cs +++ b/WarPlanes/WarPlanes/FormMapWithSetWarPlanes.Designer.cs @@ -1,4 +1,4 @@ -namespace WarPlanes +namespace AirFighter { partial class FormMapWithSetWarPlanes { @@ -96,7 +96,7 @@ // buttonDown // this.buttonDown.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); - this.buttonDown.BackgroundImage = global::WarPlanes.Properties.Resources.arrowDown; + this.buttonDown.BackgroundImage = global::AirFighter.Properties.Resources.arrowDown; this.buttonDown.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Stretch; this.buttonDown.Location = new System.Drawing.Point(91, 504); this.buttonDown.Name = "buttonDown"; @@ -108,7 +108,7 @@ // buttonRight // this.buttonRight.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); - this.buttonRight.BackgroundImage = global::WarPlanes.Properties.Resources.arrowRight; + this.buttonRight.BackgroundImage = global::AirFighter.Properties.Resources.arrowRight; this.buttonRight.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Stretch; this.buttonRight.Location = new System.Drawing.Point(127, 504); this.buttonRight.Name = "buttonRight"; @@ -120,7 +120,7 @@ // buttonLeft // this.buttonLeft.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); - this.buttonLeft.BackgroundImage = global::WarPlanes.Properties.Resources.arrowLeft; + this.buttonLeft.BackgroundImage = global::AirFighter.Properties.Resources.arrowLeft; this.buttonLeft.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Stretch; this.buttonLeft.Location = new System.Drawing.Point(55, 504); this.buttonLeft.Name = "buttonLeft"; @@ -132,7 +132,7 @@ // buttonUp // this.buttonUp.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); - this.buttonUp.BackgroundImage = global::WarPlanes.Properties.Resources.arrowUp; + this.buttonUp.BackgroundImage = global::AirFighter.Properties.Resources.arrowUp; this.buttonUp.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Stretch; this.buttonUp.Location = new System.Drawing.Point(91, 468); this.buttonUp.Name = "buttonUp"; diff --git a/WarPlanes/WarPlanes/FormMapWithSetWarPlanes.cs b/WarPlanes/WarPlanes/FormMapWithSetWarPlanes.cs index 3c4d24e..2f2b50f 100644 --- a/WarPlanes/WarPlanes/FormMapWithSetWarPlanes.cs +++ b/WarPlanes/WarPlanes/FormMapWithSetWarPlanes.cs @@ -1,4 +1,4 @@ -namespace WarPlanes +namespace AirFighter { public partial class FormMapWithSetWarPlanes : Form { diff --git a/WarPlanes/WarPlanes/FormWarPlane.Designer.cs b/WarPlanes/WarPlanes/FormWarPlane.Designer.cs index 486bbed..89a83cb 100644 --- a/WarPlanes/WarPlanes/FormWarPlane.Designer.cs +++ b/WarPlanes/WarPlanes/FormWarPlane.Designer.cs @@ -1,4 +1,4 @@ -namespace WarPlanes +namespace AirFighter { partial class FormWarPlane { @@ -47,7 +47,7 @@ // buttonDown // this.buttonDown.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); - this.buttonDown.BackgroundImage = global::WarPlanes.Properties.Resources.arrowDown; + this.buttonDown.BackgroundImage = global::AirFighter.Properties.Resources.arrowDown; this.buttonDown.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Stretch; this.buttonDown.Location = new System.Drawing.Point(722, 386); this.buttonDown.Name = "buttonDown"; @@ -59,7 +59,7 @@ // buttonRight // this.buttonRight.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); - this.buttonRight.BackgroundImage = global::WarPlanes.Properties.Resources.arrowRight; + this.buttonRight.BackgroundImage = global::AirFighter.Properties.Resources.arrowRight; this.buttonRight.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Stretch; this.buttonRight.Location = new System.Drawing.Point(758, 386); this.buttonRight.Name = "buttonRight"; @@ -71,7 +71,7 @@ // buttonLeft // this.buttonLeft.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); - this.buttonLeft.BackgroundImage = global::WarPlanes.Properties.Resources.arrowLeft; + this.buttonLeft.BackgroundImage = global::AirFighter.Properties.Resources.arrowLeft; this.buttonLeft.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Stretch; this.buttonLeft.Location = new System.Drawing.Point(686, 386); this.buttonLeft.Name = "buttonLeft"; @@ -83,7 +83,7 @@ // buttonUp // this.buttonUp.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); - this.buttonUp.BackgroundImage = global::WarPlanes.Properties.Resources.arrowUp; + this.buttonUp.BackgroundImage = global::AirFighter.Properties.Resources.arrowUp; this.buttonUp.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Stretch; this.buttonUp.Location = new System.Drawing.Point(722, 350); this.buttonUp.Name = "buttonUp"; diff --git a/WarPlanes/WarPlanes/FormWarPlane.cs b/WarPlanes/WarPlanes/FormWarPlane.cs index 7b6682b..5e6c347 100644 --- a/WarPlanes/WarPlanes/FormWarPlane.cs +++ b/WarPlanes/WarPlanes/FormWarPlane.cs @@ -1,4 +1,4 @@ -namespace WarPlanes +namespace AirFighter { public partial class FormWarPlane : Form { diff --git a/WarPlanes/WarPlanes/IDrawningObject.cs b/WarPlanes/WarPlanes/IDrawningObject.cs index 8002336..3d6457c 100644 --- a/WarPlanes/WarPlanes/IDrawningObject.cs +++ b/WarPlanes/WarPlanes/IDrawningObject.cs @@ -1,4 +1,4 @@ -namespace WarPlanes +namespace AirFighter { internal interface IDrawningObject { diff --git a/WarPlanes/WarPlanes/MapWithSetWarPlanesGeneric.cs b/WarPlanes/WarPlanes/MapWithSetWarPlanesGeneric.cs index f933dc2..1a2594b 100644 --- a/WarPlanes/WarPlanes/MapWithSetWarPlanesGeneric.cs +++ b/WarPlanes/WarPlanes/MapWithSetWarPlanesGeneric.cs @@ -1,4 +1,4 @@ -namespace WarPlanes +namespace AirFighter { /// /// Карта с набром объектов под нее diff --git a/WarPlanes/WarPlanes/Program.cs b/WarPlanes/WarPlanes/Program.cs index 6236a91..70f3587 100644 --- a/WarPlanes/WarPlanes/Program.cs +++ b/WarPlanes/WarPlanes/Program.cs @@ -1,4 +1,4 @@ -namespace WarPlanes +namespace AirFighter { internal static class Program { diff --git a/WarPlanes/WarPlanes/Properties/Resources.Designer.cs b/WarPlanes/WarPlanes/Properties/Resources.Designer.cs index bb2583b..657b5a0 100644 --- a/WarPlanes/WarPlanes/Properties/Resources.Designer.cs +++ b/WarPlanes/WarPlanes/Properties/Resources.Designer.cs @@ -8,7 +8,7 @@ // //------------------------------------------------------------------------------ -namespace WarPlanes.Properties { +namespace AirFighter.Properties { using System; @@ -39,7 +39,7 @@ namespace WarPlanes.Properties { internal static global::System.Resources.ResourceManager ResourceManager { get { if (object.ReferenceEquals(resourceMan, null)) { - global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("WarPlanes.Properties.Resources", typeof(Resources).Assembly); + global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("AirFighter.Properties.Resources", typeof(Resources).Assembly); resourceMan = temp; } return resourceMan; diff --git a/WarPlanes/WarPlanes/SetWarPlanesGeneric.cs b/WarPlanes/WarPlanes/SetWarPlanesGeneric.cs index 25d0707..669f92f 100644 --- a/WarPlanes/WarPlanes/SetWarPlanesGeneric.cs +++ b/WarPlanes/WarPlanes/SetWarPlanesGeneric.cs @@ -1,4 +1,4 @@ -namespace WarPlanes +namespace AirFighter { /// /// Параметризованный набор объектов diff --git a/WarPlanes/WarPlanes/SimpleMap.cs b/WarPlanes/WarPlanes/SimpleMap.cs index 1e26bca..7529e0c 100644 --- a/WarPlanes/WarPlanes/SimpleMap.cs +++ b/WarPlanes/WarPlanes/SimpleMap.cs @@ -1,4 +1,4 @@ -namespace WarPlanes +namespace AirFighter { /// /// Простая реализация абсрактного класса AbstractMap diff --git a/WarPlanes/WarPlanes/СloseMap.cs b/WarPlanes/WarPlanes/СloseMap.cs index fef90cc..83e09b2 100644 --- a/WarPlanes/WarPlanes/СloseMap.cs +++ b/WarPlanes/WarPlanes/СloseMap.cs @@ -1,4 +1,4 @@ -namespace WarPlanes +namespace AirFighter { /// /// Простая реализация абсрактного класса AbstractMap From 692995dcae1327d1df48bc40cbd66cd126c588a0 Mon Sep 17 00:00:00 2001 From: m1aksim1 Date: Thu, 27 Oct 2022 14:46:32 +0400 Subject: [PATCH 4/4] =?UTF-8?q?=D0=B8=D0=B7=D0=BC=D0=B5=D0=BD=D0=B5=D0=BD?= =?UTF-8?q?=D0=B8=D0=B5=20=D0=BD=D0=B0=D0=B7=D0=B2=D0=B0=D0=BD=D0=B8=D0=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- WarPlanes/WarPlanes/MapWithSetWarPlanesGeneric.cs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/WarPlanes/WarPlanes/MapWithSetWarPlanesGeneric.cs b/WarPlanes/WarPlanes/MapWithSetWarPlanesGeneric.cs index 1a2594b..687f8d4 100644 --- a/WarPlanes/WarPlanes/MapWithSetWarPlanesGeneric.cs +++ b/WarPlanes/WarPlanes/MapWithSetWarPlanesGeneric.cs @@ -169,9 +169,9 @@ int maxLeft = (countInLine - 1) * _placeSizeWidth; for (int i = 0; i < _setWarPlanes.Count; i++) { - var airplane = _setWarPlanes.Get(i); - airplane?.SetObject(maxLeft - i % countInLine * _placeSizeWidth +10, _pictureHeight - _placeSizeHeight - i / countInLine * _placeSizeHeight, _pictureWidth, _pictureHeight); - airplane?.DrawningObject(g); + var warplane = _setWarPlanes.Get(i); + warplane?.SetObject(maxLeft - i % countInLine * _placeSizeWidth +10, _pictureHeight - _placeSizeHeight - i / countInLine * _placeSizeHeight, _pictureWidth, _pictureHeight); + warplane?.DrawningObject(g); } } }