From 0449822d9eb20216179b345caf5b8ae47c341b46 Mon Sep 17 00:00:00 2001 From: Pavel_Sorokin Date: Wed, 19 Oct 2022 18:03:48 +0400 Subject: [PATCH] =?UTF-8?q?=D0=9B=D0=B8=D1=88=D0=BD=D0=B8=D0=B5=20=D1=81?= =?UTF-8?q?=D1=82=D1=80=D0=BE=D1=87=D0=BA=D0=B8=20=D0=BA=D0=BE=D0=B4=D0=B0?= =?UTF-8?q?=20=D1=83=D0=B1=D1=80=D0=B0=D0=BD=D1=8B.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Liner/Liner/FormMapWithSetShips.Designer.cs | 1 - Liner/Liner/FormMapWithSetShips.cs | 29 --------------------- 2 files changed, 30 deletions(-) diff --git a/Liner/Liner/FormMapWithSetShips.Designer.cs b/Liner/Liner/FormMapWithSetShips.Designer.cs index 40d145a..064deb1 100644 --- a/Liner/Liner/FormMapWithSetShips.Designer.cs +++ b/Liner/Liner/FormMapWithSetShips.Designer.cs @@ -133,7 +133,6 @@ this.ComboBoxSelectorMap.Name = "ComboBoxSelectorMap"; this.ComboBoxSelectorMap.Size = new System.Drawing.Size(222, 28); this.ComboBoxSelectorMap.TabIndex = 9; - this.ComboBoxSelectorMap.SelectedIndexChanged += new System.EventHandler(this.ComboBoxSelectorMap_SelectedIndexChanged); // // buttonRight // diff --git a/Liner/Liner/FormMapWithSetShips.cs b/Liner/Liner/FormMapWithSetShips.cs index 8e10dc0..340096c 100644 --- a/Liner/Liner/FormMapWithSetShips.cs +++ b/Liner/Liner/FormMapWithSetShips.cs @@ -13,7 +13,6 @@ namespace Liner { public partial class FormMapWithSetShips : Form { - private MapWithSetShipsGeneric _mapShipsCollectionGeneric; private readonly Dictionary _mapDict = new() { {"Простая карта", new SimpleMap() }, @@ -50,31 +49,6 @@ namespace Liner ListBoxMaps.SelectedIndex = index; } } - private void ComboBoxSelectorMap_SelectedIndexChanged(object sender, EventArgs e) - { - AbstractMap map = null; - switch (ComboBoxSelectorMap.Text) - { - case "Простая карта": - map = new SimpleMap(); - break; - case "Море и айсберги": - map = new SeaMap(); - break; - case "Болото": - map = new SwampMap(); - break; - } - if (map != null) - { - _mapShipsCollectionGeneric = new MapWithSetShipsGeneric( - pictureBox.Width, pictureBox.Height, map); - } - else - { - _mapShipsCollectionGeneric = null; - } - } private void ButtonAddShip_Click(object sender, EventArgs e) { if (ListBoxMaps.SelectedIndex == -1) @@ -162,7 +136,6 @@ namespace Liner } pictureBox.Image = _mapsCollection[ListBoxMaps.SelectedItem?.ToString() ?? string.Empty].MoveObject(dir); } - private void ButtonAddMap_Click(object sender, EventArgs e) { if (ComboBoxSelectorMap.SelectedIndex == -1 || string.IsNullOrEmpty(textBoxNewMapName.Text)) @@ -178,12 +151,10 @@ namespace Liner _mapsCollection.AddMap(textBoxNewMapName.Text, _mapDict[ComboBoxSelectorMap.Text]); ReloadMaps(); } - private void ListBoxMaps_SelectedIndexChanged(object sender, EventArgs e) { pictureBox.Image = _mapsCollection[ListBoxMaps.SelectedItem?.ToString() ?? string.Empty].ShowSet(); } - private void ButtonDeleteMap_Click(object sender, EventArgs e) { if (ListBoxMaps.SelectedIndex == -1)