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)