From eb6e8d6ccee8995128caa527f2464bc89bd4cb08 Mon Sep 17 00:00:00 2001 From: Pavel_Sorokin Date: Fri, 30 Sep 2022 09:34:58 +0400 Subject: [PATCH] =?UTF-8?q?=D0=A3=D0=B1=D1=80=D0=B0=D0=BD=D1=8B=20=D0=BB?= =?UTF-8?q?=D0=B8=D1=88=D0=BD=D0=B8=D0=B5=20=D1=81=D1=82=D1=80=D0=BE=D1=87?= =?UTF-8?q?=D0=BA=D0=B8.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Liner/Liner/FormMap.cs | 35 +++-------------------------------- 1 file changed, 3 insertions(+), 32 deletions(-) diff --git a/Liner/Liner/FormMap.cs b/Liner/Liner/FormMap.cs index 53e5bfd..4315453 100644 --- a/Liner/Liner/FormMap.cs +++ b/Liner/Liner/FormMap.cs @@ -24,24 +24,8 @@ namespace Liner toolStripStatusLabelSpeed.Text = $"Скорость: {ship.Ship.Speed}"; toolStripStatusLabelWeight.Text = $"Вес: {ship.Ship.Weight}"; toolStripStatusLabelBodyColor.Text = $"Цвет: {ship.Ship.BodyColor.Name}"; - if (comboBoxSelectorMap.Text == "Простая карта") - { - pictureBoxShip.Image = _abstractMap.CreateMap(pictureBoxShip.Width, pictureBoxShip.Height, new DrawingObjectShip(ship)); - new DrawingObjectShip(ship); - } - if (comboBoxSelectorMap.Text == "Море и айсберги") - { - pictureBoxShip.Image = _abstractMap.CreateMap(pictureBoxShip.Width, pictureBoxShip.Height, new DrawingObjectShip(ship)); - new DrawingObjectShip(ship); - } - if (comboBoxSelectorMap.Text == "Болото") - { - pictureBoxShip.Image = _abstractMap.CreateMap(pictureBoxShip.Width, pictureBoxShip.Height, new DrawingObjectShip(ship)); - new DrawingObjectShip(ship); - } - - - + pictureBoxShip.Image = _abstractMap.CreateMap(pictureBoxShip.Width, pictureBoxShip.Height, new DrawingObjectShip(ship)); + new DrawingObjectShip(ship); } @@ -55,7 +39,6 @@ namespace Liner } private void ButtonMove_Click(object sender, EventArgs e) { - //получаем имя кнопки string name = ((Button)sender)?.Name ?? string.Empty; Direction dir = Direction.None; switch (name) @@ -73,19 +56,7 @@ namespace Liner dir = Direction.Right; break; } - if (comboBoxSelectorMap.Text == "Простая карта") - { - pictureBoxShip.Image = _abstractMap?.MoveObject(dir); - } - if (comboBoxSelectorMap.Text == "Море и айсберги") - { - pictureBoxShip.Image = _abstractMap?.MoveObject(dir); - } - if (comboBoxSelectorMap.Text == "Болото") - { - pictureBoxShip.Image = _abstractMap?.MoveObject(dir); - } - + pictureBoxShip.Image = _abstractMap?.MoveObject(dir); } private void ButtonCreateModif_Click(object sender, EventArgs e)