(RioOpener.TryOpen): use LINQ syntax.

This commit is contained in:
morkt
2016-12-15 10:54:09 +04:00
parent eb9c5128a0
commit 48bb4bc59f

View File

@@ -67,13 +67,14 @@ namespace GameRes.Formats.Rugp
reader.DeserializeRelic(); reader.DeserializeRelic();
var nodes = reader.Arc.LoadArray.OfType<COceanNode>(); var nodes = reader.Arc.LoadArray.OfType<COceanNode>();
var types = nodes.Select (n => n.ClassName).Distinct(); var types = nodes.Select (n => n.ClassName).Distinct();
var dir = nodes.Where (n => SupportedClasses.ContainsKey (n.ClassName)) var dir = from node in nodes
.Select (n => new Entry { where SupportedClasses.ContainsKey (node.ClassName)
Name = n.Name, select new Entry {
Type = SupportedClasses[n.ClassName], Name = node.Name,
Offset = n.Offset, Type = SupportedClasses[node.ClassName],
Size = n.Size Offset = node.Offset,
}); Size = node.Size
};
if (!dir.Any()) if (!dir.Any())
return null; return null;
return new ArcFile (file, this, dir.ToList()); return new ArcFile (file, this, dir.ToList());