Добавлены методы в MapWithSetLocomotivesGeneric
This commit is contained in:
parent
0ca1f9efcb
commit
a9f39a20a9
@ -44,4 +44,8 @@ public class DrawningObjectLocomotive implements IDrawningObject {
|
||||
if (_locomotive == null) return null;
|
||||
return _locomotive.getDataForSave();
|
||||
}
|
||||
|
||||
public static IDrawningObject Create(String data) {
|
||||
return new DrawningObjectLocomotive(DrawningLocomotive.createDrawningLocomotive(data));
|
||||
}
|
||||
}
|
||||
|
@ -174,4 +174,25 @@ public class MapWithSetLocomotivesGeneric
|
||||
}
|
||||
}
|
||||
|
||||
/// Получение данных в виде строки
|
||||
public String GetData(char separatorType, char separatorData)
|
||||
{
|
||||
//string data = $"{_map.GetType().Name}{separatorType}";
|
||||
String data = ""+ _map.getClass() + separatorType;
|
||||
for (var locomotive : _setLocomotives.GetLocomotives())
|
||||
{
|
||||
data += "" + locomotive.getInfo() + separatorData;
|
||||
}
|
||||
return data;
|
||||
}
|
||||
|
||||
/// Загрузка списка из массива строк
|
||||
public void LoadData(String[] records)
|
||||
{
|
||||
for (var rec : records)
|
||||
{
|
||||
_setLocomotives.Insert((T)DrawningObjectLocomotive.Create(rec));
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user