Data PrepareData(Portion portion, Project project)
{
Data data = new Data();
data.Pipes = new List<PipeObject>();
data.Joints = new List<JointObject>();
data.Components = new List<ComponentObject>();
data.Project = project;
foreach(var pipe in portion.Pipes)
{
data.Pipes.Add(new PipeObject(pipe));
}
foreach(var joint in portion.Joints)
{
data.Joints.Add(new JointObject(joint));
}
foreach(var component in portion.Components)
{
data.Components.Add(new ComponentObject(component));
}
return data;
}