Добавлены методы сериализации и десериализации в класс MapWithSetArtilleriesGeneric
This commit is contained in:
parent
baff437cf5
commit
cd93fadd3b
@ -124,5 +124,23 @@ namespace Artilleries
|
|||||||
index++;
|
index++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public string GetData(char separatorType, char separatorData)
|
||||||
|
{
|
||||||
|
string data = $"{_map.GetType().Name}{separatorType}";
|
||||||
|
foreach (var artillery in _setArtilleries.GetArtilleries())
|
||||||
|
{
|
||||||
|
data += $"{artillery.GetInfo()}{separatorData}";
|
||||||
|
}
|
||||||
|
return data;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void LoadData(string[] records)
|
||||||
|
{
|
||||||
|
foreach (var record in records)
|
||||||
|
{
|
||||||
|
_setArtilleries.Insert(DrawingObjectArtillery.Create(record) as T);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user