From 981cccdaa563f402f1119c9b25dccb31b9873cad Mon Sep 17 00:00:00 2001 From: GokaPek <109132407+GokaPek@users.noreply.github.com> Date: Wed, 25 Oct 2023 09:21:32 +0400 Subject: [PATCH] =?UTF-8?q?=D0=A2=D1=80=D0=B5=D1=82=D0=B8=D0=B9=20=D1=8D?= =?UTF-8?q?=D1=82=D0=B0=D0=BF=20=D1=81=D0=BD=D0=BE=D0=B2=D0=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../SelfPropelledArtilleryUnit/FormSPAUCollection.cs | 6 ++---- .../SelfPropelledArtilleryUnit/SPAUGenericCollection.cs | 2 +- .../SelfPropelledArtilleryUnit/SetGeneric.cs | 7 +------ 3 files changed, 4 insertions(+), 11 deletions(-) diff --git a/SelfPropelledArtilleryUnit/SelfPropelledArtilleryUnit/FormSPAUCollection.cs b/SelfPropelledArtilleryUnit/SelfPropelledArtilleryUnit/FormSPAUCollection.cs index 9407145..45f2ba6 100644 --- a/SelfPropelledArtilleryUnit/SelfPropelledArtilleryUnit/FormSPAUCollection.cs +++ b/SelfPropelledArtilleryUnit/SelfPropelledArtilleryUnit/FormSPAUCollection.cs @@ -89,8 +89,7 @@ namespace SelfPropelledArtilleryUnit } if (MessageBox.Show($"Удалить объект {listBoxStorages.SelectedItem}?", "Удаление", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes) { - _storage.DelSet(listBoxStorages.SelectedItem.ToString() - ?? string.Empty); + _storage.DelSet(listBoxStorages.SelectedItem.ToString() ?? string.Empty); ReloadObjects(); } } @@ -139,8 +138,7 @@ namespace SelfPropelledArtilleryUnit { return; } - var obj = _storage[listBoxStorages.SelectedItem.ToString() ?? - string.Empty]; + var obj = _storage[listBoxStorages.SelectedItem.ToString() ?? string.Empty]; if (obj == null) { return; diff --git a/SelfPropelledArtilleryUnit/SelfPropelledArtilleryUnit/SPAUGenericCollection.cs b/SelfPropelledArtilleryUnit/SelfPropelledArtilleryUnit/SPAUGenericCollection.cs index e388ee0..0a4a07f 100644 --- a/SelfPropelledArtilleryUnit/SelfPropelledArtilleryUnit/SPAUGenericCollection.cs +++ b/SelfPropelledArtilleryUnit/SelfPropelledArtilleryUnit/SPAUGenericCollection.cs @@ -136,7 +136,7 @@ namespace SelfPropelledArtilleryUnit.Generics for (int i = 0; i < _collection.Count; i++) { current = _collection[i]; - current?.SetPosition(stringCount * 200, 280 - j * 100); + current?.SetPosition(stringCount * _placeSizeWidth, 280 - j * _placeSizeHeight); stringCount++; if (stringCount >= 3) { diff --git a/SelfPropelledArtilleryUnit/SelfPropelledArtilleryUnit/SetGeneric.cs b/SelfPropelledArtilleryUnit/SelfPropelledArtilleryUnit/SetGeneric.cs index ccec5e1..85aef92 100644 --- a/SelfPropelledArtilleryUnit/SelfPropelledArtilleryUnit/SetGeneric.cs +++ b/SelfPropelledArtilleryUnit/SelfPropelledArtilleryUnit/SetGeneric.cs @@ -103,12 +103,7 @@ namespace SelfPropelledArtilleryUnit.Generics { if (position < 0 || position >= _maxCount) return; - if(_places[position] == null) - { - _places[position] = value; - return; - } - _places.Insert(position, value); + _places[position] = value; } } ///