From bd2998b662c4a33833c19405a68f3017baa2e934 Mon Sep 17 00:00:00 2001 From: foxkerik6 Date: Tue, 29 Nov 2022 04:45:44 +0400 Subject: [PATCH 1/8] =?UTF-8?q?=D0=B4=D0=BE=D0=B1=D0=B0=D0=B2=D0=BB=D0=B5?= =?UTF-8?q?=D0=BD=D0=B8=D0=B5=20=D1=84=D0=B8=D0=BB=D1=8C=D1=82=D1=80=D0=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Stormtrooper/Stormtrooper/FormMapWithSetAirplane.cs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Stormtrooper/Stormtrooper/FormMapWithSetAirplane.cs b/Stormtrooper/Stormtrooper/FormMapWithSetAirplane.cs index 117782f..991a017 100644 --- a/Stormtrooper/Stormtrooper/FormMapWithSetAirplane.cs +++ b/Stormtrooper/Stormtrooper/FormMapWithSetAirplane.cs @@ -28,6 +28,8 @@ namespace Stormtrooper public FormMapWithSetAirplane() { InitializeComponent(); + openFileDialog.Filter = "Text files(*.txt)|*.txt"; + saveFileDialog.Filter = "Text files(*.txt)|*.txt"; _mapCollection = new MapCollection(pictureBox.Width, pictureBox.Height); comboBoxMapSelector.Items.Clear(); foreach(var map in _mapsDict) -- 2.25.1 From 0a5fc475d22799ad7b587b1e63ff7d7711a016fa Mon Sep 17 00:00:00 2001 From: foxkerik6 Date: Tue, 29 Nov 2022 06:08:45 +0400 Subject: [PATCH 2/8] =?UTF-8?q?=D0=BF=D1=80=D0=BE=D0=B1=D0=BB=D0=B5=D0=BC?= =?UTF-8?q?=D1=8B=20=D1=81=20serialog?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Stormtrooper/AirplaneNotFoundException.cs | 18 ++++ .../Stormtrooper/FormMapWithSetAirplane.cs | 89 +++++++++++++++---- Stormtrooper/Stormtrooper/MapCollection.cs | 10 +-- Stormtrooper/Stormtrooper/Program.cs | 34 +++++-- .../Stormtrooper/SetAirplaneGeneric.cs | 4 +- .../Stormtrooper/StorageOverFlowException.cs | 19 ++++ Stormtrooper/Stormtrooper/Stormtrooper.csproj | 9 ++ Stormtrooper/Stormtrooper/appSetting.json | 20 +++++ 8 files changed, 170 insertions(+), 33 deletions(-) create mode 100644 Stormtrooper/Stormtrooper/AirplaneNotFoundException.cs create mode 100644 Stormtrooper/Stormtrooper/StorageOverFlowException.cs create mode 100644 Stormtrooper/Stormtrooper/appSetting.json diff --git a/Stormtrooper/Stormtrooper/AirplaneNotFoundException.cs b/Stormtrooper/Stormtrooper/AirplaneNotFoundException.cs new file mode 100644 index 0000000..15efd6c --- /dev/null +++ b/Stormtrooper/Stormtrooper/AirplaneNotFoundException.cs @@ -0,0 +1,18 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Runtime.Serialization; +using System.Text; +using System.Threading.Tasks; + +namespace Stormtrooper +{ + internal class AirplaneNotFoundException : ApplicationException + { + public AirplaneNotFoundException() : base() { } + public AirplaneNotFoundException(int i) : base($"Не найден объект по позиции {i}") { } + public AirplaneNotFoundException(string message) : base(message) { } + public AirplaneNotFoundException(string message, Exception exception) : base(message, exception) { } + protected AirplaneNotFoundException(SerializationInfo info, StreamingContext contex) : base(info, contex) { } + } +} diff --git a/Stormtrooper/Stormtrooper/FormMapWithSetAirplane.cs b/Stormtrooper/Stormtrooper/FormMapWithSetAirplane.cs index 991a017..e385ff9 100644 --- a/Stormtrooper/Stormtrooper/FormMapWithSetAirplane.cs +++ b/Stormtrooper/Stormtrooper/FormMapWithSetAirplane.cs @@ -1,4 +1,5 @@ -using Strormtrooper; +using Microsoft.Extensions.Logging; +using Strormtrooper; using System; using System.Collections.Generic; using System.ComponentModel; @@ -20,14 +21,15 @@ namespace Stormtrooper {"Опасная карта", new DangerMap()}, {"Облачная карта", new CloudMap()} }; + private readonly ILogger _logger; /// /// Объект от коллекции карт /// private readonly MapCollection _mapCollection; - private MapWithSetAirplaneGeneric _mapAirsCollectionGeneric; - public FormMapWithSetAirplane() + public FormMapWithSetAirplane(ILogger logger) { InitializeComponent(); + _logger = logger; openFileDialog.Filter = "Text files(*.txt)|*.txt"; saveFileDialog.Filter = "Text files(*.txt)|*.txt"; _mapCollection = new MapCollection(pictureBox.Width, pictureBox.Height); @@ -63,16 +65,25 @@ namespace Stormtrooper { if (comboBoxMapSelector.SelectedIndex == -1 || string.IsNullOrEmpty(textBoxMapName.Text)) { + _logger.LogInformation("Не все данные заполнены при попытке создании карты"); MessageBox.Show("Не все данные заполнены", "Ошибка", MessageBoxButtons.OK, MessageBoxIcon.Error); return; } if (!_mapsDict.ContainsKey(comboBoxMapSelector.Text)) { + _logger.LogInformation($"Нет карты с названием {comboBoxMapSelector.Text}"); MessageBox.Show("Нет такой карты", "Ошибка", MessageBoxButtons.OK, MessageBoxIcon.Error); return; } + if (textBoxMapName.Text.Contains('|') || textBoxMapName.Text.Contains(':') || textBoxMapName.Text.Contains(';')) + { + _logger.LogInformation("Присутствуют символы, недопустимые для имени карты"); + MessageBox.Show("Присутствуют символы, недопустимые для имени карты", "Ошибка", MessageBoxButtons.OK, MessageBoxIcon.Error); + return; + } _mapCollection.AddMap(textBoxMapName.Text, _mapsDict[comboBoxMapSelector.Text]); ReloadMaps(); + _logger.LogInformation($"Добавлена карта {textBoxMapName.Text}"); } /// /// Добавление объекта @@ -92,15 +103,31 @@ namespace Stormtrooper return; } DrawningObject airplane = new(drawningMilitaryAirplane); - if (_mapCollection[listBoxMap.SelectedItem?.ToString() ?? string.Empty] + airplane != -1) + try { - MessageBox.Show("Объект добавлен"); - pictureBox.Image = _mapCollection[listBoxMap.SelectedItem?.ToString() ?? string.Empty].ShowSet(); + if (_mapCollection[listBoxMap.SelectedItem?.ToString() ?? string.Empty] + airplane != -1) + { + _logger.LogInformation($"Добавление объекта {airplane}"); + MessageBox.Show("Объект добавлен"); + pictureBox.Image = _mapCollection[listBoxMap.SelectedItem?.ToString() ?? string.Empty].ShowSet(); + } + else + { + _logger.LogInformation("Не удалось добавить объект"); + MessageBox.Show("Не удалось добавить объект"); + } } - else + catch (StorageOverflowException ex) { - MessageBox.Show("Не удалось добавить объект"); + _logger.LogWarning($"Ошибка переполнения хранилища: {ex.Message}"); + MessageBox.Show($"Ошибка переполнения хранилища: {ex.Message}", "Результат", MessageBoxButtons.OK, MessageBoxIcon.Error); } + catch (Exception ex) + { + _logger.LogWarning($"Неизвестная ошибка: {ex.Message}"); + MessageBox.Show($"Неизвестная ошибка: {ex.Message}"); + } + } /// /// Удаление объекта @@ -122,15 +149,31 @@ namespace Stormtrooper return; } int pos = Convert.ToInt32(maskedTextBoxPosition.Text); - if (_mapCollection[listBoxMap.SelectedItem?.ToString() ?? string.Empty] - pos != null) + try { - MessageBox.Show("Объект удален"); - pictureBox.Image = _mapCollection[listBoxMap.SelectedItem?.ToString() ?? string.Empty].ShowSet(); + var deletedAirplane = _mapCollection[listBoxMap.SelectedItem?.ToString() ?? string.Empty] - pos; + if (deletedAirplane != null) + { + _logger.LogInformation($"Объект {deletedAirplane} удалён"); + MessageBox.Show("Объект удален"); + pictureBox.Image = _mapCollection[listBoxMap.SelectedItem?.ToString() ?? string.Empty].ShowSet(); + } + else + { + MessageBox.Show("Не удалось удалить объект"); + } } - else + catch (AirplaneNotFoundException ex) { - MessageBox.Show("Не удалось удалить объект"); + _logger.LogWarning($"Ошибка удаления: {ex.Message}"); + MessageBox.Show($"Ошибка удаления: {ex.Message}"); } + catch(Exception ex) + { + _logger.LogWarning($"Неизвестная ошибка: {ex.Message}"); + MessageBox.Show($"Неизвестная ошибка: {ex.Message}"); + } + } /// /// Вывод набора @@ -193,6 +236,7 @@ namespace Stormtrooper private void listBoxMap_SelectedIndexChanged(object sender, EventArgs e) { pictureBox.Image = _mapCollection[listBoxMap.SelectedItem?.ToString() ?? string.Empty].ShowSet(); + _logger.LogInformation($"Текущая карта сменена на {listBoxMap.SelectedItem?.ToString() ?? string.Empty}"); } private void ButtonRemoveMap_Click(object sender, EventArgs e) { @@ -205,6 +249,7 @@ namespace Stormtrooper { _mapCollection.DelMap(listBoxMap.SelectedItem?.ToString() ?? string.Empty); ReloadMaps(); + _logger.LogInformation($"Удалена карта {listBoxMap.SelectedItem?.ToString() ?? string.Empty}"); } } @@ -212,13 +257,16 @@ namespace Stormtrooper { if (saveFileDialog.ShowDialog() == DialogResult.OK) { - if (_mapCollection.SaveData(saveFileDialog.FileName)) + try { + _mapCollection.SaveData(saveFileDialog.FileName); + _logger.LogInformation($"Успешное сохранение по пути {saveFileDialog.FileName}"); MessageBox.Show("Сохранение прошло успешно", "Результат", MessageBoxButtons.OK, MessageBoxIcon.Information); } - else + catch (Exception ex) { - MessageBox.Show("Не сохранилось", "Результат", MessageBoxButtons.OK, MessageBoxIcon.Error); + _logger.LogWarning($"Не удалось сохранить данные. Ошибка - {ex.Message}"); + MessageBox.Show($"Не сохранилось: {ex.Message}", "Результат", MessageBoxButtons.OK, MessageBoxIcon.Error); } } } @@ -227,14 +275,17 @@ namespace Stormtrooper { if (openFileDialog.ShowDialog() == DialogResult.OK) { - if (_mapCollection.LoadData(openFileDialog.FileName)) + try { + _mapCollection.LoadData(openFileDialog.FileName); ReloadMaps(); + _logger.LogInformation($"Успешная загрузка по пути {openFileDialog.FileName}"); MessageBox.Show("Загрузка прошла успешно", "Результат", MessageBoxButtons.OK, MessageBoxIcon.Information); } - else + catch (Exception ex) { - MessageBox.Show("Не получилось загрузить файл", "Результат", MessageBoxButtons.OK, MessageBoxIcon.Error); + _logger.LogWarning($"Не удалось загрузить данные. Ошибка - {ex.Message}"); + MessageBox.Show($"Не загрузилось: {ex.Message}", "Результат", MessageBoxButtons.OK, MessageBoxIcon.Error); } } } diff --git a/Stormtrooper/Stormtrooper/MapCollection.cs b/Stormtrooper/Stormtrooper/MapCollection.cs index 07d2181..b48d44b 100644 --- a/Stormtrooper/Stormtrooper/MapCollection.cs +++ b/Stormtrooper/Stormtrooper/MapCollection.cs @@ -64,7 +64,7 @@ namespace Stormtrooper _mapStorages.Remove(name); } - public bool SaveData(string filename) + public void SaveData(string filename) { if (File.Exists(filename)) { @@ -78,18 +78,17 @@ namespace Stormtrooper sw.Write($"{storage.Key}{separatorDict}{storage.Value.GetData(separatorDict, separatorData)}{Environment.NewLine}"); } } - return true; } /// /// Загрузка информации по локомотивам в депо из файла /// /// /// - public bool LoadData(string filename) + public void LoadData(string filename) { if (!File.Exists(filename)) { - return false; + throw new FileNotFoundException("Файл не найден"); } using (StreamReader sr = new(filename)) { @@ -97,7 +96,7 @@ namespace Stormtrooper if (!str.Contains("MapCollection")) { //если нет такой записи, то это не те данные - return false; + throw new FileFormatException("Формат данных в файле неправильный"); } _mapStorages.Clear(); while ((str = sr.ReadLine()) != null) @@ -120,7 +119,6 @@ namespace Stormtrooper _mapStorages[elem[0]].LoadData(elem[2].Split(separatorData, StringSplitOptions.RemoveEmptyEntries)); } } - return true; } diff --git a/Stormtrooper/Stormtrooper/Program.cs b/Stormtrooper/Stormtrooper/Program.cs index 65b5334..50685ff 100644 --- a/Stormtrooper/Stormtrooper/Program.cs +++ b/Stormtrooper/Stormtrooper/Program.cs @@ -1,8 +1,7 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Threading.Tasks; -using System.Windows.Forms; +using Microsoft.Extensions.Configuration; +using Microsoft.Extensions.DependencyInjection; +using Microsoft.Extensions.Logging; +using Serilog; namespace Stormtrooper { @@ -16,7 +15,30 @@ namespace Stormtrooper { Application.EnableVisualStyles(); Application.SetCompatibleTextRenderingDefault(false); - Application.Run(new FormMapWithSetAirplane()); + ApplicationConfiguration.Initialize(); + var services = new ServiceCollection(); + ConfigureServices(services); + using (ServiceProvider serviceProvider = services.BuildServiceProvider()) + { + Application.Run(serviceProvider.GetRequiredService()); + } + } + private static void ConfigureServices(ServiceCollection services) + { + services.AddSingleton() + .AddLogging(option => + { + var configuration = new ConfigurationBuilder() + .SetBasePath(Directory.GetCurrentDirectory()) + .AddJsonFile(path: "appSettings.json", optional: false, reloadOnChange: true) + .Build(); + + var logger = new LoggerConfiguration() + .ReadFrom.Configuration(configuration); + + option.SetMinimumLevel(LogLevel.Information); + option.AddSerilog(logger); + }); } } } diff --git a/Stormtrooper/Stormtrooper/SetAirplaneGeneric.cs b/Stormtrooper/Stormtrooper/SetAirplaneGeneric.cs index bd13158..04001c0 100644 --- a/Stormtrooper/Stormtrooper/SetAirplaneGeneric.cs +++ b/Stormtrooper/Stormtrooper/SetAirplaneGeneric.cs @@ -48,7 +48,7 @@ namespace Stormtrooper public int Insert(T airplane, int position) { if (position < 0 || position >= _maxCount - 1) - return -1; + throw new StorageOverflowException(_maxCount); _places.Insert(position, airplane); return position; @@ -61,7 +61,7 @@ namespace Stormtrooper public T Remove(int position) { if (Count == 0 || position < 0 || position >= _maxCount) - return null; + throw new AirplaneNotFoundException(position); T air = _places[position]; _places[position] = null; return air; diff --git a/Stormtrooper/Stormtrooper/StorageOverFlowException.cs b/Stormtrooper/Stormtrooper/StorageOverFlowException.cs new file mode 100644 index 0000000..fe2aa4a --- /dev/null +++ b/Stormtrooper/Stormtrooper/StorageOverFlowException.cs @@ -0,0 +1,19 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Runtime.Serialization; +using System.Text; +using System.Threading.Tasks; + +namespace Stormtrooper +{ + [Serializable] + internal class StorageOverflowException : ApplicationException + { + public StorageOverflowException(int count) : base($"В наборе превышено допустимое количество: {count}") { } + public StorageOverflowException() : base() { } + public StorageOverflowException(string message) : base(message) { } + public StorageOverflowException(string message, Exception exception) : base(message, exception) { } + protected StorageOverflowException(SerializationInfo info, StreamingContext contex) : base(info, contex) { } + } +} diff --git a/Stormtrooper/Stormtrooper/Stormtrooper.csproj b/Stormtrooper/Stormtrooper/Stormtrooper.csproj index 9ee8484..30817a2 100644 --- a/Stormtrooper/Stormtrooper/Stormtrooper.csproj +++ b/Stormtrooper/Stormtrooper/Stormtrooper.csproj @@ -8,6 +8,15 @@ enable + + + + + + + + + Form diff --git a/Stormtrooper/Stormtrooper/appSetting.json b/Stormtrooper/Stormtrooper/appSetting.json new file mode 100644 index 0000000..a6e6f97 --- /dev/null +++ b/Stormtrooper/Stormtrooper/appSetting.json @@ -0,0 +1,20 @@ +{ + "Serilog": { + "Using": [ "Serilog.Sinks.File" ], + "MinimumLevel": "Information", + "WriteTo": [ + { + "Name": "File", + "Args": { + "path": "log_.log", + "rollingInterval": "Day", + "outputTemplate": "[{Timestamp:HH:mm:ss.fff}]{Level:u4}: {Message:lj}{NewLine}{Exception}" + } + } + ], + "Enrich": [ "FromLogContext", "WithMachineName", "WithThreadId" ], + "Properties": { + "Application": "Stormtrooper" + } + } +} \ No newline at end of file -- 2.25.1 From 30ad241b99f7a4c25007e7847c099053d83f8f0a Mon Sep 17 00:00:00 2001 From: ker73rus Date: Tue, 29 Nov 2022 10:54:21 +0400 Subject: [PATCH 3/8] =?UTF-8?q?=D0=B3=D0=BE=D1=82=D0=BE=D0=B2=D0=BE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Stormtrooper/Stormtrooper/Program.cs | 5 +++-- .../Stormtrooper/SetAirplaneGeneric.cs | 6 +++--- Stormtrooper/Stormtrooper/Stormtrooper.csproj | 19 +++++++++++++++++++ 3 files changed, 25 insertions(+), 5 deletions(-) diff --git a/Stormtrooper/Stormtrooper/Program.cs b/Stormtrooper/Stormtrooper/Program.cs index 50685ff..d2bef84 100644 --- a/Stormtrooper/Stormtrooper/Program.cs +++ b/Stormtrooper/Stormtrooper/Program.cs @@ -30,11 +30,12 @@ namespace Stormtrooper { var configuration = new ConfigurationBuilder() .SetBasePath(Directory.GetCurrentDirectory()) - .AddJsonFile(path: "appSettings.json", optional: false, reloadOnChange: true) + .AddJsonFile(path: "appSetting.json", optional: false, reloadOnChange: true) .Build(); var logger = new LoggerConfiguration() - .ReadFrom.Configuration(configuration); + .ReadFrom.Configuration(configuration) + .CreateLogger(); option.SetMinimumLevel(LogLevel.Information); option.AddSerilog(logger); diff --git a/Stormtrooper/Stormtrooper/SetAirplaneGeneric.cs b/Stormtrooper/Stormtrooper/SetAirplaneGeneric.cs index 04001c0..90a54e1 100644 --- a/Stormtrooper/Stormtrooper/SetAirplaneGeneric.cs +++ b/Stormtrooper/Stormtrooper/SetAirplaneGeneric.cs @@ -34,8 +34,8 @@ namespace Stormtrooper /// public int Insert(T airplane) { - if (Count == _maxCount) - return -1; + if (Count >= _maxCount) + throw new StorageOverflowException(_maxCount); Insert(airplane, 0); return 0; } @@ -63,7 +63,7 @@ namespace Stormtrooper if (Count == 0 || position < 0 || position >= _maxCount) throw new AirplaneNotFoundException(position); T air = _places[position]; - _places[position] = null; + _places.RemoveAt(position); return air; } /// diff --git a/Stormtrooper/Stormtrooper/Stormtrooper.csproj b/Stormtrooper/Stormtrooper/Stormtrooper.csproj index 30817a2..627cd34 100644 --- a/Stormtrooper/Stormtrooper/Stormtrooper.csproj +++ b/Stormtrooper/Stormtrooper/Stormtrooper.csproj @@ -8,13 +8,30 @@ enable + + + + + + + Always + + + + + + + + + + @@ -23,4 +40,6 @@ + + \ No newline at end of file -- 2.25.1 From 4dec93f91808c6670676e9a81b0df5a20e8e131c Mon Sep 17 00:00:00 2001 From: foxkerik6 Date: Thu, 1 Dec 2022 00:00:48 +0400 Subject: [PATCH 4/8] =?UTF-8?q?=D0=B5=D1=89=D1=91=20=D0=BF=D0=BE=D0=BF?= =?UTF-8?q?=D1=80=D0=B0=D0=B2=D0=BA=D0=B8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Stormtrooper/Stormtrooper/FormMapWithSetAirplane.cs | 4 ++-- Stormtrooper/Stormtrooper/MapWithSetAirplaneGeneric.cs | 2 -- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/Stormtrooper/Stormtrooper/FormMapWithSetAirplane.cs b/Stormtrooper/Stormtrooper/FormMapWithSetAirplane.cs index e385ff9..15524e4 100644 --- a/Stormtrooper/Stormtrooper/FormMapWithSetAirplane.cs +++ b/Stormtrooper/Stormtrooper/FormMapWithSetAirplane.cs @@ -15,21 +15,21 @@ namespace Stormtrooper { public partial class FormMapWithSetAirplane : Form { + private readonly ILogger _logger; private readonly Dictionary _mapsDict = new() { {"Простая карта", new SimpleMap()}, {"Опасная карта", new DangerMap()}, {"Облачная карта", new CloudMap()} }; - private readonly ILogger _logger; /// /// Объект от коллекции карт /// private readonly MapCollection _mapCollection; public FormMapWithSetAirplane(ILogger logger) { - InitializeComponent(); _logger = logger; + InitializeComponent(); openFileDialog.Filter = "Text files(*.txt)|*.txt"; saveFileDialog.Filter = "Text files(*.txt)|*.txt"; _mapCollection = new MapCollection(pictureBox.Width, pictureBox.Height); diff --git a/Stormtrooper/Stormtrooper/MapWithSetAirplaneGeneric.cs b/Stormtrooper/Stormtrooper/MapWithSetAirplaneGeneric.cs index 89a9b65..d55c86d 100644 --- a/Stormtrooper/Stormtrooper/MapWithSetAirplaneGeneric.cs +++ b/Stormtrooper/Stormtrooper/MapWithSetAirplaneGeneric.cs @@ -185,8 +185,6 @@ namespace Stormtrooper int currentWidth = width - 1; int currentHeight = 0; - - int i = 0; foreach (var air in _setAirs.GetAirs()) { -- 2.25.1 From 6834a0e49678e59e78fa91b62930716c65eff874 Mon Sep 17 00:00:00 2001 From: foxkerik6 Date: Thu, 1 Dec 2022 00:03:16 +0400 Subject: [PATCH 5/8] =?UTF-8?q?=D0=B8=20=D0=B5=D1=89=D1=91=20=D0=BF=D0=BE?= =?UTF-8?q?=D0=BF=D1=80=D0=B0=D0=B2=D0=BA=D0=B8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Stormtrooper/Stormtrooper/MapWithSetAirplaneGeneric.cs | 1 + 1 file changed, 1 insertion(+) diff --git a/Stormtrooper/Stormtrooper/MapWithSetAirplaneGeneric.cs b/Stormtrooper/Stormtrooper/MapWithSetAirplaneGeneric.cs index d55c86d..d563533 100644 --- a/Stormtrooper/Stormtrooper/MapWithSetAirplaneGeneric.cs +++ b/Stormtrooper/Stormtrooper/MapWithSetAirplaneGeneric.cs @@ -185,6 +185,7 @@ namespace Stormtrooper int currentWidth = width - 1; int currentHeight = 0; + foreach (var air in _setAirs.GetAirs()) { -- 2.25.1 From e6a679301dfa3e87cbef8b508acf05b63d00abb2 Mon Sep 17 00:00:00 2001 From: foxkerik6 Date: Thu, 1 Dec 2022 00:05:43 +0400 Subject: [PATCH 6/8] =?UTF-8?q?=D0=B8=20=D0=B5=D1=89=D1=91=20=D1=81=D0=B0?= =?UTF-8?q?=D0=BC=D1=83=D1=8E=20=D0=BC=D0=B0=D0=BB=D0=BE=D1=81=D1=82=D1=8C?= =?UTF-8?q?=20=D0=BF=D0=BE=D0=BF=D1=80=D0=B0=D0=B2=D0=BE=D0=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Stormtrooper/Stormtrooper/FormMapWithSetAirplane.cs | 1 + 1 file changed, 1 insertion(+) diff --git a/Stormtrooper/Stormtrooper/FormMapWithSetAirplane.cs b/Stormtrooper/Stormtrooper/FormMapWithSetAirplane.cs index 15524e4..a343626 100644 --- a/Stormtrooper/Stormtrooper/FormMapWithSetAirplane.cs +++ b/Stormtrooper/Stormtrooper/FormMapWithSetAirplane.cs @@ -26,6 +26,7 @@ namespace Stormtrooper /// Объект от коллекции карт /// private readonly MapCollection _mapCollection; + public FormMapWithSetAirplane(ILogger logger) { _logger = logger; -- 2.25.1 From bd4cfcf2ec7c885e7dc1fc176b4885ed11250fc8 Mon Sep 17 00:00:00 2001 From: foxkerik6 Date: Thu, 1 Dec 2022 00:07:21 +0400 Subject: [PATCH 7/8] ... --- Stormtrooper/Stormtrooper/FormMapWithSetAirplane.cs | 1 + 1 file changed, 1 insertion(+) diff --git a/Stormtrooper/Stormtrooper/FormMapWithSetAirplane.cs b/Stormtrooper/Stormtrooper/FormMapWithSetAirplane.cs index a343626..1b25be7 100644 --- a/Stormtrooper/Stormtrooper/FormMapWithSetAirplane.cs +++ b/Stormtrooper/Stormtrooper/FormMapWithSetAirplane.cs @@ -28,6 +28,7 @@ namespace Stormtrooper private readonly MapCollection _mapCollection; public FormMapWithSetAirplane(ILogger logger) + { _logger = logger; InitializeComponent(); -- 2.25.1 From c219c255790f627f5b51b565956f3fc7c5c08f24 Mon Sep 17 00:00:00 2001 From: foxkerik6 Date: Thu, 1 Dec 2022 00:10:54 +0400 Subject: [PATCH 8/8] =?UTF-8?q?=D1=83=20=D0=BC=D0=B5=D0=BD=D1=8F=20=D1=83?= =?UTF-8?q?=D0=B6=D0=B5=20=D0=BD=D0=B5=D1=82=20=D0=B8=D0=B4=D0=B5=D0=B9,?= =?UTF-8?q?=20=D0=BA=D0=B0=D0=BA=20=D0=B8=D0=B7=D0=B1=D0=B0=D0=B2=D0=B8?= =?UTF-8?q?=D1=82=D1=8C=D1=81=D1=8F=20=D0=BE=D1=82=20=D0=BA=D0=BE=D0=BD?= =?UTF-8?q?=D1=84=D0=BB=D0=B8=D0=BA=D1=82=D0=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Stormtrooper/Stormtrooper/FormMapWithSetAirplane.cs | 2 -- 1 file changed, 2 deletions(-) diff --git a/Stormtrooper/Stormtrooper/FormMapWithSetAirplane.cs b/Stormtrooper/Stormtrooper/FormMapWithSetAirplane.cs index 1b25be7..15524e4 100644 --- a/Stormtrooper/Stormtrooper/FormMapWithSetAirplane.cs +++ b/Stormtrooper/Stormtrooper/FormMapWithSetAirplane.cs @@ -26,9 +26,7 @@ namespace Stormtrooper /// Объект от коллекции карт /// private readonly MapCollection _mapCollection; - public FormMapWithSetAirplane(ILogger logger) - { _logger = logger; InitializeComponent(); -- 2.25.1