Agliullov D. A. Lab Work 7 Base #15
@ -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();
|
||||
}
|
||||
|
@ -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))
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user