Canguro.Model.Serializer.Deserializer.readConstraintAssignments C# (CSharp) Method

readConstraintAssignments() private method

private readConstraintAssignments ( XmlNode node ) : void
node System.Xml.XmlNode
return void
        private void readConstraintAssignments(XmlNode node)
        {
            try
            {
                Dictionary<string, Constraint> map = new Dictionary<string, Constraint>();
                foreach (Constraint cons in model.ConstraintList)
                    if (cons != null)
                        map.Add(cons.Name, cons);

                foreach (XmlNode child in node.ChildNodes)
                    if ("Joint".Equals(child.Name))
                    {
                        int jid = int.Parse(readAttribute(child, "Joint", "0"));
                        string consName = readAttribute(child, "Constraint");

                        if (map.ContainsKey(consName) && model.JointList[jid] != null)
                            model.JointList[jid].Constraint = map[consName];

            //                        readAttribute(child, "Type", j.Constraint.ConstraintType.ToString());
                    }
            }
            catch (Exception ex)
            {
                Console.WriteLine(ex);
            }
        }
Deserializer