Третий этап снова

This commit is contained in:
GokaPek 2023-10-25 09:21:32 +04:00
parent f1924cb952
commit 981cccdaa5
3 changed files with 4 additions and 11 deletions

View File

@ -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;

View File

@ -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)
{

View File

@ -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;
}
}
/// <summary>