зафиксировать
This commit is contained in:
parent
e085b87859
commit
a59a70a69b
@ -6,6 +6,7 @@ using System.Threading.Tasks;
|
|||||||
|
|
||||||
using ProjectBoat_bae.DrawningObjects;
|
using ProjectBoat_bae.DrawningObjects;
|
||||||
using ProjectBoat_bae.MovementStrategy;
|
using ProjectBoat_bae.MovementStrategy;
|
||||||
|
using ProjectBoat_bae.Entities;
|
||||||
|
|
||||||
namespace ProjectBoat_bae.Generics
|
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<string, BoatsGenericCollection<Drawningboat, DrawningObjectBoat>> 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<Drawningboat, DrawningObjectBoat> 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 static readonly char _separatorForKeyValue = '|';
|
||||||
private readonly char _separatorRecords = ';';
|
private readonly char _separatorRecords = ';';
|
||||||
private static readonly char _separatorForObject = ':';
|
private static readonly char _separatorForObject = ':';
|
||||||
|
Loading…
x
Reference in New Issue
Block a user