diff --git a/MotorBoat/MotorBoat/DrawningMotorBoat.cs b/MotorBoat/MotorBoat/DrawningBoat.cs similarity index 94% rename from MotorBoat/MotorBoat/DrawningMotorBoat.cs rename to MotorBoat/MotorBoat/DrawningBoat.cs index 1764659..a759b3e 100644 --- a/MotorBoat/MotorBoat/DrawningMotorBoat.cs +++ b/MotorBoat/MotorBoat/DrawningBoat.cs @@ -7,9 +7,9 @@ using System.Threading.Tasks; namespace MotorBoat { - class DrawningMotorBoat + class DrawningBoat { - public EntityMotorBoat Boat { get; private set; } + public EntityBoat Boat { get; private set; } private float _startPosX; private float _startPosY; @@ -19,10 +19,9 @@ namespace MotorBoat private readonly int _boatWidth = 70; private readonly int _boatHeight = 40; - public void Init(int speed, float weight, Color bodyColor) + public DrawningBoat(int speed, float weight, Color bodyColor) { - Boat = new EntityMotorBoat(); - Boat.Init(speed, weight, bodyColor); + Boat = new EntityBoat(speed, weight, bodyColor); } public void SetPosition(int x, int y, int width, int height) { diff --git a/MotorBoat/MotorBoat/EntityMotorBoat.cs b/MotorBoat/MotorBoat/EntityBoat.cs similarity index 86% rename from MotorBoat/MotorBoat/EntityMotorBoat.cs rename to MotorBoat/MotorBoat/EntityBoat.cs index c9daad9..2b1b66e 100644 --- a/MotorBoat/MotorBoat/EntityMotorBoat.cs +++ b/MotorBoat/MotorBoat/EntityBoat.cs @@ -7,13 +7,13 @@ using System.Threading.Tasks; namespace MotorBoat { - class EntityMotorBoat + class EntityBoat { 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) + public EntityBoat(int speed, float weight, Color bodyColor) { Random rnd = new Random(); Speed = speed <= 0 ? rnd.Next(50, 150) : speed; diff --git a/MotorBoat/MotorBoat/FormMotorBoat.Designer.cs b/MotorBoat/MotorBoat/FormBoat.Designer.cs similarity index 99% rename from MotorBoat/MotorBoat/FormMotorBoat.Designer.cs rename to MotorBoat/MotorBoat/FormBoat.Designer.cs index 611854f..1cd67b2 100644 --- a/MotorBoat/MotorBoat/FormMotorBoat.Designer.cs +++ b/MotorBoat/MotorBoat/FormBoat.Designer.cs @@ -1,6 +1,6 @@ namespace MotorBoat { - partial class FormMotorBoat + partial class FormBoat { /// /// Required designer variable. diff --git a/MotorBoat/MotorBoat/FormMotorBoat.cs b/MotorBoat/MotorBoat/FormBoat.cs similarity index 86% rename from MotorBoat/MotorBoat/FormMotorBoat.cs rename to MotorBoat/MotorBoat/FormBoat.cs index 03277b0..46e195e 100644 --- a/MotorBoat/MotorBoat/FormMotorBoat.cs +++ b/MotorBoat/MotorBoat/FormBoat.cs @@ -8,10 +8,10 @@ using System.Windows.Forms; namespace MotorBoat { - public partial class FormMotorBoat : Form + public partial class FormBoat : Form { - private DrawningMotorBoat _boat; - public FormMotorBoat() + private DrawningBoat _boat; + public FormBoat() { InitializeComponent(); } @@ -19,8 +19,7 @@ namespace MotorBoat private void ButtonCreate_Click(object sender, EventArgs e) { Random rnd = new Random(); - _boat = new DrawningMotorBoat(); - _boat.Init(rnd.Next(50, 150), rnd.Next(100, 200), Color.FromArgb(rnd.Next(0, 256), rnd.Next(0, 256), rnd.Next(0, 256))); + _boat = new DrawningBoat(rnd.Next(50, 150), rnd.Next(100, 200), Color.FromArgb(rnd.Next(0, 256), rnd.Next(0, 256), rnd.Next(0, 256))); _boat.SetPosition(rnd.Next(10, 100), rnd.Next(0,100), pictureBoxMotorBoat.Width, pictureBoxMotorBoat.Height); toolStripStatusLabelSpeed.Text = $"Ñêîðîñòü: {_boat.Boat.Speed}"; toolStripStatusLabelWeight.Text = $"Âåñ: {_boat.Boat.Weight}"; diff --git a/MotorBoat/MotorBoat/FormMotorBoat.resx b/MotorBoat/MotorBoat/FormBoat.resx similarity index 100% rename from MotorBoat/MotorBoat/FormMotorBoat.resx rename to MotorBoat/MotorBoat/FormBoat.resx diff --git a/MotorBoat/MotorBoat/Program.cs b/MotorBoat/MotorBoat/Program.cs index 83aea91..921b216 100644 --- a/MotorBoat/MotorBoat/Program.cs +++ b/MotorBoat/MotorBoat/Program.cs @@ -11,7 +11,7 @@ namespace MotorBoat // To customize application configuration such as set high DPI settings or default font, // see https://aka.ms/applicationconfiguration. ApplicationConfiguration.Initialize(); - Application.Run(new FormMotorBoat()); + Application.Run(new FormBoat()); } } } \ No newline at end of file