internal Link(XmlNode node) { Name = node.Attributes?["name"]?.Value; List <Visual> visuals = new List <Visual>(); List <Light> lights = new List <Light>(); Visuals = visuals.AsReadOnly(); Lights = lights.AsReadOnly(); foreach (XmlNode child in node.ChildNodes) { switch (child.Name) { case "gravity": Gravity = BoolElement.ValueOf(child); break; case "enable_wind": EnableWind = BoolElement.ValueOf(child); break; case "self_collide": SelfCollide = BoolElement.ValueOf(child); break; case "kinematic": Kinematic = BoolElement.ValueOf(child); break; case "must_be_base_link": MustBeBaseLink = BoolElement.ValueOf(child); break; case "pose": Pose = new Pose(child); break; case "visual": visuals.Add(new Visual(child)); break; case "light": lights.Add(new Light(child)); break; } } HasUri = Visuals.Any(visual => visual.HasUri); }