Лишние строчки кода убраны.
This commit is contained in:
parent
dd17a5a4e9
commit
0449822d9e
1
Liner/Liner/FormMapWithSetShips.Designer.cs
generated
1
Liner/Liner/FormMapWithSetShips.Designer.cs
generated
@ -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
|
||||
//
|
||||
|
@ -13,7 +13,6 @@ namespace Liner
|
||||
{
|
||||
public partial class FormMapWithSetShips : Form
|
||||
{
|
||||
private MapWithSetShipsGeneric<DrawingObjectShip, AbstractMap> _mapShipsCollectionGeneric;
|
||||
private readonly Dictionary<string, AbstractMap> _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<DrawingObjectShip, AbstractMap>(
|
||||
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)
|
||||
|
Loading…
Reference in New Issue
Block a user