fixed checks

This commit is contained in:
Калышев Ян 2022-10-10 08:51:30 +04:00
parent 25432d45f9
commit 9bee85d77b
2 changed files with 13 additions and 1 deletions

View File

@ -75,7 +75,7 @@ namespace PIbd_22_Kalyshev_Y_V_MotorBoat_Base
/// <param name="e"></param>
private void ListBoxMaps_SelectedIndexChanged(object sender, EventArgs e)
{
pictureBox.Image = _mapsCollection[listBoxMaps.SelectedItem?.ToString() ?? string.Empty].ShowSet();
pictureBox.Image = _mapsCollection[listBoxMaps.SelectedItem?.ToString() ?? string.Empty].ShowOnMap();
}
/// <summary>
/// Удаление карты

View File

@ -45,6 +45,18 @@ namespace PIbd_22_Kalyshev_Y_V_MotorBoat_Base
/// <param name="map">Карта</param>
public void AddMap(string name, AbstractMap map)
{
if (name == null)
{
return;
}
foreach (var key in _mapStorages.Keys)
{
if (key.Equals(name))
{
MessageBox.Show("Объект с таким именем существует!");
return;
}
}
_mapStorages.Add(name, new MapWithSetBoatsGeneric<DrawningObjectBoat, AbstractMap>(_pictureWidth, _pictureHeight, map));
}
/// <summary>