Ejemplo n.º 1
0
        public static TmxObjectTypes FromXmlFile(string xmlPath)
        {
            TmxObjectTypes tmxObjectTypes = new TmxObjectTypes();

            foreach (XElement item in XDocument.Load(xmlPath).Element("objecttypes").Elements("objecttype"))
            {
                TmxObjectType tmxObjectType = TmxObjectType.FromXml(item);
                tmxObjectTypes.TmxObjectTypeMapping[tmxObjectType.Name] = tmxObjectType;
            }
            return(tmxObjectTypes);
        }
Ejemplo n.º 2
0
        public static TmxObjectTypes FromXmlFile(string xmlPath)
        {
            TmxObjectTypes xmlObjectTypes = new TmxObjectTypes();

            XDocument doc = XDocument.Load(xmlPath);

            foreach (var xml in doc.Element("objecttypes").Elements("objecttype"))
            {
                TmxObjectType tmxObjectType = TmxObjectType.FromXml(xml);
                xmlObjectTypes.TmxObjectTypeMapping[tmxObjectType.Name] = tmxObjectType;
            }

            return(xmlObjectTypes);
        }