public static IrrNode Get(IrrData data) { IrrNode node = new IrrNode(); Copy(data, node); return node; }
public static void Copy(IrrData data, IrrNode node) { foreach (IrrData child in data.Children) { if (string.IsNullOrEmpty(child.Attr.Name)) continue; switch (child.Attr.Name.ToLower()) { case "name": node.Name = child.Attr.Value as string; break; case "id": node.ID = (int)child.Attr.Value; break; case "position": node.Position = child.Attr.Value as float[]; break; case "rotation": node.Rotation = child.Attr.Value as float[]; break; case "scale": node.Scale = child.Attr.Value as float[]; break; case "visible": node.Visible = (bool)child.Attr.Value; break; } } }
public void AddNode(IrrNode node) { nodes.Add(node); }