From 25af5744caae0872ced0d0005bedd8d8405845ac Mon Sep 17 00:00:00 2001 From: Zakharov_Rostislav Date: Thu, 9 Nov 2023 15:23:09 +0400 Subject: [PATCH] some minir fixes --- .../ProjectBattleship/FormShipsCollection.cs | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/ProjectBattleship/ProjectBattleship/FormShipsCollection.cs b/ProjectBattleship/ProjectBattleship/FormShipsCollection.cs index 81e68e9..af5ccfe 100644 --- a/ProjectBattleship/ProjectBattleship/FormShipsCollection.cs +++ b/ProjectBattleship/ProjectBattleship/FormShipsCollection.cs @@ -104,20 +104,19 @@ namespace ProjectBattleship { return; } - var obj = _storage[listBoxStorages.SelectedItem.ToString() ?? + var storage = _storage[listBoxStorages.SelectedItem.ToString() ?? string.Empty]; - if (obj == null) + if (storage == null) { return; } FormShipConfig form = new(pictureBoxCollection.Width, pictureBoxCollection.Height); form.Show(); - ShipDelegate? shipDelegate = new((m) => { - bool q = (obj + m); - if (q) + ShipDelegate? shipDelegate = new((ship) => { + if (storage + ship) { MessageBox.Show("Объект добавлен"); - pictureBoxCollection.Image = obj.ShowShips(); + pictureBoxCollection.Image = storage.ShowShips(); } else {