From a59a70a69b1921b9afb705ee669ee8d313f43087 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=A3=D1=87=D0=B5=D0=B1=D0=BD=D1=8B=D0=B9?= Date: Sun, 26 Nov 2023 14:11:41 +0400 Subject: [PATCH] =?UTF-8?q?=D0=B7=D0=B0=D1=84=D0=B8=D0=BA=D1=81=D0=B8?= =?UTF-8?q?=D1=80=D0=BE=D0=B2=D0=B0=D1=82=D1=8C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Generics/BoatsGenericStorage.cs | 91 +------------------ 1 file changed, 1 insertion(+), 90 deletions(-) diff --git a/ProjectBoat_base/ProjectBoat_bae/Generics/BoatsGenericStorage.cs b/ProjectBoat_base/ProjectBoat_bae/Generics/BoatsGenericStorage.cs index 38d6fe2..3e62279 100644 --- a/ProjectBoat_base/ProjectBoat_bae/Generics/BoatsGenericStorage.cs +++ b/ProjectBoat_base/ProjectBoat_bae/Generics/BoatsGenericStorage.cs @@ -6,6 +6,7 @@ using System.Threading.Tasks; using ProjectBoat_bae.DrawningObjects; using ProjectBoat_bae.MovementStrategy; +using ProjectBoat_bae.Entities; namespace ProjectBoat_bae.Generics { @@ -44,96 +45,6 @@ namespace ProjectBoat_bae.Generics } } - //// Разделитель для записи ключа и значения элемента словаря - //private static readonly char _separatorForKeyValue = '|'; - - //// Разделитель для записей коллекции данных в файл - //private readonly char _separatorRecords = ';'; - - //// Разделитель для записи информации по объекту в файл - //private static readonly char _separatorForObject = ':'; - - //// Сохранение информации по автомобилям в хранилище в файл - //public bool SaveData(string filename) - //{ - // if (File.Exists(filename)) - // { - // File.Delete(filename); - // } - // StringBuilder data = new(); - // foreach (KeyValuePair> record in _boatStorages) - // { - // StringBuilder records = new(); - // foreach (Drawningboat? elem in record.Value.GetBoats) - // { - // records.Append($"{elem?.GetDataForSave(_separatorForObject)}{_separatorRecords}"); - // } - // data.AppendLine($"{record.Key}{_separatorForKeyValue}{records}"); - // } - // if (data.Length == 0) - // { - // return false; - // } - // using (StreamWriter writer = new StreamWriter(filename)) - // { - // writer.Write($"PlaneStorage{Environment.NewLine}{data}"); - // } - // return true; - //} - - ///// Загрузка информации в хранилище из файла - //public bool LoadData(string filename) - //{ - // if (!File.Exists(filename)) - // { - // return false; - // } - - // using (StreamReader fs = File.OpenText(filename)) - // { - // string str = fs.ReadLine(); - // if (str == null || str.Length == 0) - // { - // return false; - // } - // if (!str.StartsWith("PlaneStorage")) - // { - // return false; - // } - - // _boatStorages.Clear(); - // string strs = ""; - - // while ((strs = fs.ReadLine()) != null) - // { - // if (strs == null) - // { - // return false; - // } - - // string[] record = strs.Split(_separatorForKeyValue, StringSplitOptions.RemoveEmptyEntries); - // if (record.Length != 2) - // { - // continue; - // } - // BoatsGenericCollection collection = new(_pictureWidth, _pictureHeight); - // string[] set = record[1].Split(_separatorRecords, StringSplitOptions.RemoveEmptyEntries); - // foreach (string elem in set) - // { - // Drawningboat? plane = elem?.CreateDrawningBoat(_separatorForObject, _pictureWidth, _pictureHeight); - // if (plane != null) - // { - // if (!(collection + plane)) - // { - // return false; - // } - // } - // } - // _boatStorages.Add(record[0], collection); - // } - // return true; - // } - private static readonly char _separatorForKeyValue = '|'; private readonly char _separatorRecords = ';'; private static readonly char _separatorForObject = ':';