diff --git a/Warship/Warship.sln b/Warship/Warship.sln index e4e7043..82429d8 100644 --- a/Warship/Warship.sln +++ b/Warship/Warship.sln @@ -3,7 +3,7 @@ Microsoft Visual Studio Solution File, Format Version 12.00 # Visual Studio Version 17 VisualStudioVersion = 17.3.32901.215 MinimumVisualStudioVersion = 10.0.40219.1 -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Warship", "Warship\Warship.csproj", "{9CFF4FD7-9721-45C9-84DC-020B509D6024}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "AircraftCarrier", "Warship\AircraftCarrier.csproj", "{9CFF4FD7-9721-45C9-84DC-020B509D6024}" EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution diff --git a/Warship/Warship/Warship.csproj b/Warship/Warship/AircraftCarrier.csproj similarity index 100% rename from Warship/Warship/Warship.csproj rename to Warship/Warship/AircraftCarrier.csproj diff --git a/Warship/Warship/Direction.cs b/Warship/Warship/Direction.cs index 83590ab..3237c42 100644 --- a/Warship/Warship/Direction.cs +++ b/Warship/Warship/Direction.cs @@ -4,7 +4,7 @@ using System.Linq; using System.Text; using System.Threading.Tasks; -namespace Warship +namespace AircraftCarrier { /// /// Направление перемещения diff --git a/Warship/Warship/DrawingWarship.cs b/Warship/Warship/DrawingWarship.cs index 5f28a1e..a2164c5 100644 --- a/Warship/Warship/DrawingWarship.cs +++ b/Warship/Warship/DrawingWarship.cs @@ -4,7 +4,7 @@ using System.Linq; using System.Text; using System.Threading.Tasks; -namespace Warship +namespace AircraftCarrier { /// /// Класс, отвечающий за прорисовку и перемещение объекта-сущности @@ -45,10 +45,9 @@ namespace Warship /// Скорость /// Вес корабля /// Цвет - public void Init(int speed, float weight, Color bodyColor) + public DrawingWarship(int speed, float weight, Color bodyColor) { - Ship = new EntityWarship(); - Ship.Init(speed, weight, bodyColor); + Ship = new EntityWarship(speed, weight, bodyColor); } /// /// Установка позиции корабля diff --git a/Warship/Warship/EntityWarship.cs b/Warship/Warship/EntityWarship.cs index 74a511d..cc726d6 100644 --- a/Warship/Warship/EntityWarship.cs +++ b/Warship/Warship/EntityWarship.cs @@ -4,7 +4,7 @@ using System.Linq; using System.Text; using System.Threading.Tasks; -namespace Warship +namespace AircraftCarrier { /// /// Класс-сущность "Военный корабль" @@ -34,7 +34,7 @@ namespace Warship /// /// /// - public void Init(int speed, float weight, Color bodyColor) + public EntityWarship(int speed, float weight, Color bodyColor) { Random rnd = new Random(); Speed = speed <= 0 ? rnd.Next(50, 100) : speed; diff --git a/Warship/Warship/FormShip.Designer.cs b/Warship/Warship/FormShip.Designer.cs index 77b08e2..8d35a8a 100644 --- a/Warship/Warship/FormShip.Designer.cs +++ b/Warship/Warship/FormShip.Designer.cs @@ -1,4 +1,4 @@ -namespace Warship +namespace AircraftCarrier { partial class FormShip { @@ -96,7 +96,7 @@ // buttonLeft // this.buttonLeft.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); - this.buttonLeft.BackgroundImage = global::Warship.Properties.Resources.стрелка; + this.buttonLeft.BackgroundImage = global::AircraftCarrier.Properties.Resources.стрелка; this.buttonLeft.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Stretch; this.buttonLeft.Location = new System.Drawing.Point(657, 375); this.buttonLeft.Name = "buttonLeft"; @@ -108,7 +108,7 @@ // buttonDown // this.buttonDown.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); - this.buttonDown.BackgroundImage = global::Warship.Properties.Resources.стрелкаbott; + this.buttonDown.BackgroundImage = global::AircraftCarrier.Properties.Resources.стрелкаbott; this.buttonDown.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Stretch; this.buttonDown.Location = new System.Drawing.Point(693, 375); this.buttonDown.Name = "buttonDown"; @@ -120,7 +120,7 @@ // buttonUp // this.buttonUp.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); - this.buttonUp.BackgroundImage = global::Warship.Properties.Resources.стрелкаtop; + this.buttonUp.BackgroundImage = global::AircraftCarrier.Properties.Resources.стрелкаtop; this.buttonUp.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Stretch; this.buttonUp.Location = new System.Drawing.Point(693, 339); this.buttonUp.Name = "buttonUp"; @@ -132,7 +132,7 @@ // buttonRight // this.buttonRight.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); - this.buttonRight.BackgroundImage = global::Warship.Properties.Resources.стрелкаright; + this.buttonRight.BackgroundImage = global::AircraftCarrier.Properties.Resources.стрелкаright; this.buttonRight.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Stretch; this.buttonRight.Location = new System.Drawing.Point(729, 375); this.buttonRight.Name = "buttonRight"; diff --git a/Warship/Warship/FormShip.cs b/Warship/Warship/FormShip.cs index 66f5862..89c3a94 100644 --- a/Warship/Warship/FormShip.cs +++ b/Warship/Warship/FormShip.cs @@ -1,4 +1,4 @@ -namespace Warship +namespace AircraftCarrier { public partial class FormShip : Form { @@ -25,8 +25,7 @@ namespace Warship private void ButtonCreate_Click(object sender, EventArgs e) { Random rnd = new(); - _ship = new DrawingWarship(); - _ship.Init(rnd.Next(50, 100), rnd.Next(20000, 30000), + _ship = new DrawingWarship(rnd.Next(50, 100), rnd.Next(20000, 30000), Color.FromArgb(rnd.Next(0, 256), rnd.Next(0, 256), rnd.Next(0, 256))); _ship.SetPosition(rnd.Next(10, 100), rnd.Next(10, 100), pictureBoxShip.Width, pictureBoxShip.Height); diff --git a/Warship/Warship/Program.cs b/Warship/Warship/Program.cs index 3eef74f..507c654 100644 --- a/Warship/Warship/Program.cs +++ b/Warship/Warship/Program.cs @@ -1,4 +1,4 @@ -namespace Warship +namespace AircraftCarrier { internal static class Program { diff --git a/Warship/Warship/Properties/Resources.Designer.cs b/Warship/Warship/Properties/Resources.Designer.cs index 0a27005..6a559e2 100644 --- a/Warship/Warship/Properties/Resources.Designer.cs +++ b/Warship/Warship/Properties/Resources.Designer.cs @@ -8,7 +8,7 @@ // //------------------------------------------------------------------------------ -namespace Warship.Properties { +namespace AircraftCarrier.Properties { using System; @@ -39,7 +39,7 @@ namespace Warship.Properties { internal static global::System.Resources.ResourceManager ResourceManager { get { if (object.ReferenceEquals(resourceMan, null)) { - global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("Warship.Properties.Resources", typeof(Resources).Assembly); + global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("AircraftCarrier.Properties.Resources", typeof(Resources).Assembly); resourceMan = temp; } return resourceMan;