fix
This commit is contained in:
parent
a3f01ebd0f
commit
0630250103
@ -64,8 +64,7 @@ namespace Tank
|
|||||||
_logger.LogInformation($"Добавлен набор: {SetTextBox.Text}");
|
_logger.LogInformation($"Добавлен набор: {SetTextBox.Text}");
|
||||||
}
|
}
|
||||||
|
|
||||||
private void ListBoxObjects_SelectedIndexChanged(object sender,
|
private void ListBoxObjects_SelectedIndexChanged(object sender, EventArgs e)
|
||||||
EventArgs e)
|
|
||||||
{
|
{
|
||||||
DrawTank.Image =
|
DrawTank.Image =
|
||||||
_storage[CollectionListBox.SelectedItem?.ToString() ?? string.Empty]?.ShowTanks();
|
_storage[CollectionListBox.SelectedItem?.ToString() ?? string.Empty]?.ShowTanks();
|
||||||
|
@ -34,10 +34,10 @@ namespace Tank
|
|||||||
public bool Insert(T tank, int position)
|
public bool Insert(T tank, int position)
|
||||||
{
|
{
|
||||||
if (position < 0 || position >= _maxCount)
|
if (position < 0 || position >= _maxCount)
|
||||||
throw new TankNotFoundException(position);
|
throw new TankNotFoundException(position); // По позиции
|
||||||
|
|
||||||
if (Count >= _maxCount)
|
if (Count >= _maxCount)
|
||||||
throw new TankStorageOverflowException(_maxCount); // Макс количество или позицию
|
throw new TankStorageOverflowException(_maxCount); // Макс количество в коллекции
|
||||||
_places.Insert(0, tank);
|
_places.Insert(0, tank);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user