BrashMonkey.Spriter.Data.IO.SCMLParser.ReadCharacterMap C# (CSharp) Method

ReadCharacterMap() private method

private ReadCharacterMap ( XmlElement element ) : void
element System.Xml.XmlElement
return void
        void ReadCharacterMap(XmlElement element)
        {
            foreach(XmlAttribute attribute in element.Attributes)
            {
                // id
                if (attribute.Name.Equals("id"))
                    m_Data.characterMap.ID = int.Parse(attribute.Value);

                // name
                else if (attribute.Name.Equals("name"))
                    m_Data.characterMap.name = attribute.Value;
            }

            // Maps
            foreach(XmlElement child in element)
            {
                SpriterMap map = new SpriterMap();
                m_Data.characterMap.maps.Add(map);

                foreach(XmlAttribute attribute in child.Attributes)
                {
                    // atlas
                    if (attribute.Name.Equals("atlas"))
                        map.atlas = int.Parse(attribute.Value);

                    // folder
                    else if (attribute.Name.Equals("folder"))
                        map.folder = int.Parse(attribute.Value);

                    // file
                    else if (attribute.Name.Equals("file"))
                        map.file = int.Parse(attribute.Value);

                    // target_atlas
                    else if (attribute.Name.Equals("target_atlas"))
                        map.targetAtlas = int.Parse(attribute.Value);

                    // target_folder
                    else if (attribute.Name.Equals("target_folder"))
                        map.targetFolder = int.Parse(attribute.Value);

                    // target_file
                    else if (attribute.Name.Equals("target_file"))
                        map.targetFile = int.Parse(attribute.Value);
                }

                // Object references
                map.sourceFile = m_Data.FindFile(map.folder, map.file);
                map.sourceAtlas = m_Data.FindAtlas(map.atlas);

                map.destinationFile = m_Data.FindFile(map.targetFolder, map.targetFile);
                map.destinationAtlas = m_Data.FindAtlas(map.targetAtlas);
            }
        }