fixed checks
This commit is contained in:
parent
25432d45f9
commit
9bee85d77b
@ -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>
|
||||
/// Удаление карты
|
||||
|
@ -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>
|
||||
|
Loading…
Reference in New Issue
Block a user