diff --git a/SelfPropelledArtilleryUnit/EntityArtillery.cs b/SelfPropelledArtilleryUnit/EntityArtillery.cs new file mode 100644 index 0000000..d3254ca --- /dev/null +++ b/SelfPropelledArtilleryUnit/EntityArtillery.cs @@ -0,0 +1,24 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace Artilleries +{ + internal class EntityArtillery + { + public int Speed { get; private set; } + public float Weight { get; private set; } + public Color BodyColor { get; private set; } + public float Step => Speed * 100 / Weight; + public void Init(int speed, float weight, Color bodyColor) + { + Random rnd = new(); + Speed = speed <= 0 ? rnd.Next(50, 150) : speed; + Weight = weight <= 0 ? rnd.Next(40, 70) : weight; + BodyColor = bodyColor; + } + + } +} diff --git a/SelfPropelledArtilleryUnit/Form1.resx b/SelfPropelledArtilleryUnit/Form1.resx deleted file mode 100644 index 1af7de1..0000000 --- a/SelfPropelledArtilleryUnit/Form1.resx +++ /dev/null @@ -1,120 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - text/microsoft-resx - - - 2.0 - - - System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - \ No newline at end of file diff --git a/SelfPropelledArtilleryUnit/Form1.Designer.cs b/SelfPropelledArtilleryUnit/FormArtillery.Designer.cs similarity index 77% rename from SelfPropelledArtilleryUnit/Form1.Designer.cs rename to SelfPropelledArtilleryUnit/FormArtillery.Designer.cs index 09ae2e1..e201ef2 100644 --- a/SelfPropelledArtilleryUnit/Form1.Designer.cs +++ b/SelfPropelledArtilleryUnit/FormArtillery.Designer.cs @@ -1,6 +1,6 @@ namespace SelfPropelledArtilleryUnit { - partial class Form1 + partial class FormArtillery { /// /// Required designer variable. @@ -28,10 +28,17 @@ /// private void InitializeComponent() { - this.components = new System.ComponentModel.Container(); + this.SuspendLayout(); + // + // FormArtillery + // + this.AutoScaleDimensions = new System.Drawing.SizeF(7F, 15F); this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; this.ClientSize = new System.Drawing.Size(800, 450); - this.Text = "Form1"; + this.Name = "FormArtillery"; + this.Text = "Artillery"; + this.ResumeLayout(false); + } #endregion diff --git a/SelfPropelledArtilleryUnit/Form1.cs b/SelfPropelledArtilleryUnit/FormArtillery.cs similarity index 57% rename from SelfPropelledArtilleryUnit/Form1.cs rename to SelfPropelledArtilleryUnit/FormArtillery.cs index bb036a8..6a3183f 100644 --- a/SelfPropelledArtilleryUnit/Form1.cs +++ b/SelfPropelledArtilleryUnit/FormArtillery.cs @@ -1,8 +1,8 @@ namespace SelfPropelledArtilleryUnit { - public partial class Form1 : Form + public partial class FormArtillery : Form { - public Form1() + public FormArtillery() { InitializeComponent(); } diff --git a/SelfPropelledArtilleryUnit/FormArtillery.resx b/SelfPropelledArtilleryUnit/FormArtillery.resx new file mode 100644 index 0000000..f298a7b --- /dev/null +++ b/SelfPropelledArtilleryUnit/FormArtillery.resx @@ -0,0 +1,60 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + \ No newline at end of file diff --git a/SelfPropelledArtilleryUnit/Program.cs b/SelfPropelledArtilleryUnit/Program.cs index a145761..a4ffd66 100644 --- a/SelfPropelledArtilleryUnit/Program.cs +++ b/SelfPropelledArtilleryUnit/Program.cs @@ -11,7 +11,7 @@ namespace SelfPropelledArtilleryUnit // To customize application configuration such as set high DPI settings or default font, // see https://aka.ms/applicationconfiguration. ApplicationConfiguration.Initialize(); - Application.Run(new Form1()); + Application.Run(new FormArtillery()); } } } \ No newline at end of file diff --git a/SelfPropelledArtilleryUnit/SelfPropelledArtilleryUnit.sln b/SelfPropelledArtilleryUnit/SelfPropelledArtilleryUnit.sln new file mode 100644 index 0000000..1b8bcb7 --- /dev/null +++ b/SelfPropelledArtilleryUnit/SelfPropelledArtilleryUnit.sln @@ -0,0 +1,25 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio Version 17 +VisualStudioVersion = 17.3.32825.248 +MinimumVisualStudioVersion = 10.0.40219.1 +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "SelfPropelledArtilleryUnit", "SelfPropelledArtilleryUnit.csproj", "{D1201BA2-52D4-4FD2-BCCE-A7384854E785}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Release|Any CPU = Release|Any CPU + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {D1201BA2-52D4-4FD2-BCCE-A7384854E785}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {D1201BA2-52D4-4FD2-BCCE-A7384854E785}.Debug|Any CPU.Build.0 = Debug|Any CPU + {D1201BA2-52D4-4FD2-BCCE-A7384854E785}.Release|Any CPU.ActiveCfg = Release|Any CPU + {D1201BA2-52D4-4FD2-BCCE-A7384854E785}.Release|Any CPU.Build.0 = Release|Any CPU + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection + GlobalSection(ExtensibilityGlobals) = postSolution + SolutionGuid = {4AC84756-85D9-4983-96C9-641A2590F78D} + EndGlobalSection +EndGlobal