From 56aa1980ca8592f2aba96a267fa23251ae810ae8 Mon Sep 17 00:00:00 2001 From: Danil Markov Date: Tue, 25 Oct 2022 08:14:20 +0400 Subject: [PATCH] fix --- ContainerShip/ContainerShip/FormMapWithSetShip.cs | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/ContainerShip/ContainerShip/FormMapWithSetShip.cs b/ContainerShip/ContainerShip/FormMapWithSetShip.cs index a617497..1e2928a 100644 --- a/ContainerShip/ContainerShip/FormMapWithSetShip.cs +++ b/ContainerShip/ContainerShip/FormMapWithSetShip.cs @@ -14,12 +14,12 @@ namespace ContainerShip { private MapWithSetShipGeneric _mapShipCollectionGeneric; - public bool onMap; + public FormMapWithSetShip() { InitializeComponent(); - onMap = false; + } private void ComboBoxSelectorMap_SelectedIndexChanged(object sender, EventArgs e) @@ -100,25 +100,23 @@ namespace ContainerShip return; } pictureBox.Image = _mapShipCollectionGeneric.ShowSet(); - onMap = false; + } private void ButtonShowOnMap_Click(object sender, EventArgs e) { if (_mapShipCollectionGeneric == null) - { - onMap = false; + { return; } pictureBox.Image = _mapShipCollectionGeneric.ShowOnMap(); - onMap = true; + } private void ButtonMove_Click(object sender, EventArgs e) { - if (_mapShipCollectionGeneric == null || !onMap) + if (_mapShipCollectionGeneric == null) { - return; } //получаем имя кнопки