This commit is contained in:
Danil Markov 2022-10-25 08:14:20 +04:00
parent 1af1d0c9b5
commit 56aa1980ca

View File

@ -14,12 +14,12 @@ namespace ContainerShip
{ {
private MapWithSetShipGeneric<DrawingObjectShip, AbstractMap> _mapShipCollectionGeneric; private MapWithSetShipGeneric<DrawingObjectShip, AbstractMap> _mapShipCollectionGeneric;
public bool onMap;
public FormMapWithSetShip() public FormMapWithSetShip()
{ {
InitializeComponent(); InitializeComponent();
onMap = false;
} }
private void ComboBoxSelectorMap_SelectedIndexChanged(object sender, EventArgs e) private void ComboBoxSelectorMap_SelectedIndexChanged(object sender, EventArgs e)
@ -100,25 +100,23 @@ namespace ContainerShip
return; return;
} }
pictureBox.Image = _mapShipCollectionGeneric.ShowSet(); pictureBox.Image = _mapShipCollectionGeneric.ShowSet();
onMap = false;
} }
private void ButtonShowOnMap_Click(object sender, EventArgs e) private void ButtonShowOnMap_Click(object sender, EventArgs e)
{ {
if (_mapShipCollectionGeneric == null) if (_mapShipCollectionGeneric == null)
{ {
onMap = false;
return; return;
} }
pictureBox.Image = _mapShipCollectionGeneric.ShowOnMap(); pictureBox.Image = _mapShipCollectionGeneric.ShowOnMap();
onMap = true;
} }
private void ButtonMove_Click(object sender, EventArgs e) private void ButtonMove_Click(object sender, EventArgs e)
{ {
if (_mapShipCollectionGeneric == null || !onMap) if (_mapShipCollectionGeneric == null)
{ {
return; return;
} }
//получаем имя кнопки //получаем имя кнопки