Пример #1
0
        private Decor LoadDecorFromXmlNode(XmlNode decorNode)
        {
            float left, top, depth;
            int   type;

            left  = float.Parse(decorNode.Attributes["Left"].Value.Replace(',', '.'), CultureInfo.InvariantCulture);
            top   = float.Parse(decorNode.Attributes["Top"].Value.Replace(',', '.'), CultureInfo.InvariantCulture);
            depth = float.Parse(decorNode.Attributes["Depth"].Value.Replace(',', '.'), CultureInfo.InvariantCulture);
            type  = int.Parse(decorNode.Attributes["Type"].Value.Replace(',', '.'), CultureInfo.InvariantCulture);
            Decor newDecor = new Decor(left, top, depth, type);

            return(newDecor);
        }
Пример #2
0
        private void LoadDecors(string fileName)
        {
            this.decorList = new List <Decor>();

            XmlDocument doc = new XmlDocument();

            doc.Load(fileName);

            XmlNodeList decorNodes = doc.DocumentElement.SelectNodes("/Maps/Map/Decors/Decor");

            foreach (XmlNode decorNode in decorNodes)
            {
                Decor newDecor = LoadDecorFromXmlNode(decorNode);
                this.decorList.Add(newDecor);
            }
        }