XmlHelper.cs 491 B

1234567891011121314151617181920212223
  1. using Microsoft.Xna.Framework;
  2. using System;
  3. using System.Collections.Generic;
  4. using System.Linq;
  5. using System.Text;
  6. using System.Threading.Tasks;
  7. using System.Xml.Linq;
  8. namespace RolePlaying.Data
  9. {
  10. public static class XmlHelper
  11. {
  12. public static XElement GetAssetElementFromXML(string filePath)
  13. {
  14. XDocument doc;
  15. using (var stream = TitleContainer.OpenStream($"Content/{filePath}.xml"))
  16. {
  17. doc = XDocument.Load(stream);
  18. }
  19. return doc.Root.Element("Asset");
  20. }
  21. }
  22. }