public static FileInfoCollection FromXml(XDocument xmlGame) { var collection = new FileInfoCollection(); XElement files = xmlGame.Root.Element("Files"); foreach (XElement fileInfo in files.Elements("FileInfo")) { var info = new FileInfo(); info.Path = fileInfo.Element("Path").Value; info.Type = fileInfo.Element("Type").Value; info.Parameters = fileInfo.Element("Parameters"); fileInfo.Elements("DependsOn") .InDocumentOrder() .All(d => { info.AddDependency(d.Value); return true; }); collection.AddFileInfo(info); } return collection; }
public void AddFileInfo(FileInfo info) { treasureMap.Add(info.Path, info); }