From 2d821c9072509b70a763f75b073f4c5278d9d662 Mon Sep 17 00:00:00 2001 From: just1valery Date: Tue, 27 Sep 2022 12:59:43 +0400 Subject: [PATCH] =?UTF-8?q?=D0=9F=D0=B5=D1=80=D0=B5=D0=B8=D0=BC=D0=B5?= =?UTF-8?q?=D0=BD=D0=BE=D0=B2=D0=B0=D0=BD=D0=B8=D0=B5=20=D0=BA=D0=BB=D0=B0?= =?UTF-8?q?=D1=81=D1=81=D0=BE=D0=B2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../{DrawningWarmlyShip.cs => DrawningShip.cs} | 10 +++++----- .../WarmlyShip/{EntityWarmlyShip.cs => EntityShip.cs} | 2 +- WarmlyShip/WarmlyShip/FormShip.cs | 4 ++-- WarmlyShip/WarmlyShip/Properties/launchSettings.json | 7 +++++++ 4 files changed, 15 insertions(+), 8 deletions(-) rename WarmlyShip/WarmlyShip/{DrawningWarmlyShip.cs => DrawningShip.cs} (95%) rename WarmlyShip/WarmlyShip/{EntityWarmlyShip.cs => EntityShip.cs} (97%) create mode 100644 WarmlyShip/WarmlyShip/Properties/launchSettings.json diff --git a/WarmlyShip/WarmlyShip/DrawningWarmlyShip.cs b/WarmlyShip/WarmlyShip/DrawningShip.cs similarity index 95% rename from WarmlyShip/WarmlyShip/DrawningWarmlyShip.cs rename to WarmlyShip/WarmlyShip/DrawningShip.cs index 29e8eb8..591ed2f 100644 --- a/WarmlyShip/WarmlyShip/DrawningWarmlyShip.cs +++ b/WarmlyShip/WarmlyShip/DrawningShip.cs @@ -1,11 +1,11 @@ namespace WarmlyShip { - internal class DrawningWarmlyShip + internal class DrawningShip { /// /// Класс-сущность /// - public EntityWarmlyShip Ship { get; private set; } + public EntityShip Ship { get; private set; } /// /// Левая координата отрисовки коробля /// @@ -38,7 +38,7 @@ /// Цвет основной части public void Init(int speed, float weight, Color bodyColor) { - Ship = new EntityWarmlyShip(); + Ship = new EntityShip(); Ship.Init(speed, weight, bodyColor); } /// @@ -133,11 +133,11 @@ g.FillPolygon(br, P); Brush brBlue = new SolidBrush(Color.LightBlue); - g.FillRectangle(brBlue, _startPosX + 70, _startPosY + 1, 70, 34); + g.FillRectangle(brBlue, _startPosX + 50, _startPosY + 1, 100, 34); Pen pen = new(Color.Black); //границы коробля - g.DrawRectangle(pen, _startPosX + 70, _startPosY + 1 , 70, 34); + g.DrawRectangle(pen, _startPosX + 50, _startPosY + 1 , 100, 34); g.DrawLine(pen, _startPosX, _startPosY + 35, _startPosX + 170, _startPosY + 35); g.DrawLine(pen, _startPosX, _startPosY + 35, _startPosX + 50, _startPosY + 65); g.DrawLine(pen, _startPosX + 50, _startPosY + 65, _startPosX + 150, _startPosY + 65); diff --git a/WarmlyShip/WarmlyShip/EntityWarmlyShip.cs b/WarmlyShip/WarmlyShip/EntityShip.cs similarity index 97% rename from WarmlyShip/WarmlyShip/EntityWarmlyShip.cs rename to WarmlyShip/WarmlyShip/EntityShip.cs index 236dd56..8d865cf 100644 --- a/WarmlyShip/WarmlyShip/EntityWarmlyShip.cs +++ b/WarmlyShip/WarmlyShip/EntityShip.cs @@ -6,7 +6,7 @@ using System.Threading.Tasks; namespace WarmlyShip { - internal class EntityWarmlyShip + internal class EntityShip { /// /// Скорость diff --git a/WarmlyShip/WarmlyShip/FormShip.cs b/WarmlyShip/WarmlyShip/FormShip.cs index 14b3681..886572f 100644 --- a/WarmlyShip/WarmlyShip/FormShip.cs +++ b/WarmlyShip/WarmlyShip/FormShip.cs @@ -2,7 +2,7 @@ namespace WarmlyShip { public partial class FormShip : Form { - private DrawningWarmlyShip _ship; + private DrawningShip _ship; public FormShip() { InitializeComponent(); @@ -22,7 +22,7 @@ namespace WarmlyShip private void buttonCreate_Click(object sender, EventArgs e) { Random rnd = new(); - _ship = new DrawningWarmlyShip(); + _ship = new DrawningShip(); _ship.Init(rnd.Next(100, 300), rnd.Next(1000, 2000), 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); toolStripStatusLabelSpeed.Text = $": {_ship.Ship.Speed}"; diff --git a/WarmlyShip/WarmlyShip/Properties/launchSettings.json b/WarmlyShip/WarmlyShip/Properties/launchSettings.json new file mode 100644 index 0000000..cff298c --- /dev/null +++ b/WarmlyShip/WarmlyShip/Properties/launchSettings.json @@ -0,0 +1,7 @@ +{ + "profiles": { + "WarmlyShip": { + "commandName": "Project" + } + } +} \ No newline at end of file