XmlHelper.cs 525 B

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