From b145445dfca6113319162bbfc0b131d06c262066 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=A1=D0=B5=D1=80=D0=B3=D0=B5=D0=B9=20=D0=9F=D0=BE=D0=BB?= =?UTF-8?q?=D0=B5=D0=B2=D0=BE=D0=B9?= Date: Mon, 12 Sep 2022 22:11:25 +0400 Subject: [PATCH] =?UTF-8?q?=D0=94=D0=BE=D0=B1=D0=B0=D0=B2=D0=BB=D0=B5?= =?UTF-8?q?=D0=BD=20=D0=BA=D0=BB=D0=B0=D1=81=D1=81=20EntityArtillery?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- SelfPropelledArtilleryUnit/EntityArtillery.cs | 24 ++++ SelfPropelledArtilleryUnit/Form1.resx | 120 ------------------ ....Designer.cs => FormArtillery.Designer.cs} | 13 +- .../{Form1.cs => FormArtillery.cs} | 4 +- SelfPropelledArtilleryUnit/FormArtillery.resx | 60 +++++++++ SelfPropelledArtilleryUnit/Program.cs | 2 +- .../SelfPropelledArtilleryUnit.sln | 25 ++++ 7 files changed, 122 insertions(+), 126 deletions(-) create mode 100644 SelfPropelledArtilleryUnit/EntityArtillery.cs delete mode 100644 SelfPropelledArtilleryUnit/Form1.resx rename SelfPropelledArtilleryUnit/{Form1.Designer.cs => FormArtillery.Designer.cs} (77%) rename SelfPropelledArtilleryUnit/{Form1.cs => FormArtillery.cs} (57%) create mode 100644 SelfPropelledArtilleryUnit/FormArtillery.resx create mode 100644 SelfPropelledArtilleryUnit/SelfPropelledArtilleryUnit.sln 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