исправления

This commit is contained in:
10Г Егор Романов 2022-12-05 01:32:59 +04:00
parent 069691bec5
commit 666c51d70b
2 changed files with 1 additions and 26 deletions

View File

@ -121,7 +121,6 @@
this.comboBoxSelectorMap.Name = "comboBoxSelectorMap"; this.comboBoxSelectorMap.Name = "comboBoxSelectorMap";
this.comboBoxSelectorMap.Size = new System.Drawing.Size(200, 28); this.comboBoxSelectorMap.Size = new System.Drawing.Size(200, 28);
this.comboBoxSelectorMap.TabIndex = 0; this.comboBoxSelectorMap.TabIndex = 0;
this.comboBoxSelectorMap.SelectedIndexChanged += new System.EventHandler(this.ComboBoxSelectorMap_SelectedIndexChanged);
// //
// textBoxNewMapName // textBoxNewMapName
// //

View File

@ -29,7 +29,6 @@ namespace HoistingCrane
/// <summary> /// <summary>
private readonly MapsCollection _mapsCollection; private readonly MapsCollection _mapsCollection;
/// <summary> /// <summary>
private MapWithSetHoistingCraneGeneric<DrawingObjectHoistingCrane, AbstractMap> _mapHoistingCraneCollectionGeneric;
public FormMapWithSetHoistingCrane(ILogger<FormMapWithSetHoistingCrane> logger) public FormMapWithSetHoistingCrane(ILogger<FormMapWithSetHoistingCrane> logger)
{ {
InitializeComponent(); InitializeComponent();
@ -63,29 +62,6 @@ namespace HoistingCrane
listBoxMaps.SelectedIndex = index; 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 SecondMap();
break;
}
if (map != null)
{
_mapHoistingCraneCollectionGeneric = new MapWithSetHoistingCraneGeneric<DrawingObjectHoistingCrane, AbstractMap>(
pictureBox.Width, pictureBox.Height, map);
}
else
{
_mapHoistingCraneCollectionGeneric = null;
}
}
/// <summary> /// <summary>
/// Добавление карты /// Добавление карты
/// </summary> /// </summary>
@ -245,7 +221,7 @@ namespace HoistingCrane
enums = Direction.Right; enums = Direction.Right;
break; break;
} }
pictureBox.Image = _mapHoistingCraneCollectionGeneric.MoveObject(enums); pictureBox.Image = _mapsCollection[listBoxMaps.SelectedItem?.ToString() ?? string.Empty].MoveObject(enums);
} }
private void saveToolStripMenuItem_Click(object sender, EventArgs e) private void saveToolStripMenuItem_Click(object sender, EventArgs e)
{ {