Agliullov D. A. Lab Work 7 Base #15

Merged
eegov merged 13 commits from Lab7 into Lab6 2022-11-07 11:29:51 +04:00
2 changed files with 4 additions and 2 deletions
Showing only changes of commit 4c76b5ca81 - Show all commits

View File

@ -24,10 +24,11 @@ namespace AirBomber
/// <summary>
/// Конструктор
/// </summary>
public FormMapWithSetAirplanes()
public FormMapWithSetAirplanes(ILogger<FormMapWithSetAirplanes> logger)
{
InitializeComponent();
_mapsCollection = new MapsCollection(pictureBox.Width, pictureBox.Height);
_logger = logger;
comboBoxSelectorMap.Items.Clear();
foreach(var elem in _mapsDict)
{
@ -73,6 +74,7 @@ namespace AirBomber
MessageBox.Show("Нет такой карты", "Ошибка", MessageBoxButtons.OK, MessageBoxIcon.Error);
return;
}
_logger.LogInformation("Добавлена карта \"%s\"", _mapsDict[comboBoxSelectorMap.Text]);
_mapsCollection.AddMap(textBoxNewMapName.Text, _mapsDict[comboBoxSelectorMap.Text]);
ReloadMaps();
}

View File

@ -54,7 +54,7 @@ namespace AirBomber
/// <returns>Возвращает позицию вставленного объекта, либо -1 если его не удалось вставить</returns>
public int Insert(T airplane, int position)
{
if (position == _maxcount)
if (Count == _maxcount)
throw new StorageOverflowException();
if (!isCorrectPosition(position))
{