Mochalov D.V. LabWork06 #6

Closed
b0n3l3sS wants to merge 7 commits from LabWork06 into LabWork05
Showing only changes of commit dded2fe5dc - Show all commits

View File

@ -158,5 +158,26 @@ namespace Locomotive
}
}
/// Получение данных в виде строки
public string GetData(char separatorType, char separatorData)
{
string data = $"{_map.GetType().Name}{separatorType}";
foreach (var locomotive in _setLocomotives.GetLocomotives())
{
data += $"{locomotive.getInfo()}{separatorData}";
}
return data;
}
/// Загрузка списка из массива строк
public void LoadData(string[] records)
{
foreach (var rec in records)
{
_setLocomotives.Insert(DrawningObjectLocomotive.Create(rec) as T);
}
}
}
}