public static ElNode Parse(ElData data) { var rt = new ElNode { baseData = data, }; foreach (var i in data.Children) { switch (i.Name) { case "NodeName": rt.NodeName = i.Values.First().Trim('"'); break; case "InitPostureMatrix": rt.InitPostureMatrix = i.Values.Select(float.Parse).ToArray(); break; case "Node": rt.Nodes.Add(Parse(i)); break; } } return(rt); }
public static ElNode Parse(ElData data) { var rt = new ElNode { baseData = data, }; foreach (var i in data.Children) switch (i.Name) { case "NodeName": rt.NodeName = i.Values.First().Trim('"'); break; case "InitPostureMatrix": rt.InitPostureMatrix = i.Values.Select(float.Parse).ToArray(); break; case "Node": rt.Nodes.Add(Parse(i)); break; } return rt; }