NHSE/NHSE.Core/Hashing/FileHashInfo.cs
Kurt 9eda5f2c10
Initial v1.8.0 Support (#452)
No savefile changes apparently, just adding in new items & handling for them.
Probably didn't need to duplicate the Main/Personal offset classes, but whatever.
2021-02-24 18:44:11 -08:00

26 lines
708 B
C#

using System.Collections.Generic;
using System.Linq;
namespace NHSE.Core
{
public sealed class FileHashInfo
{
private readonly IReadOnlyDictionary<uint, FileHashDetails> List;
public FileHashInfo(FileHashInfo dupe) : this(dupe.List.Values) { }
public FileHashInfo(IEnumerable<FileHashDetails> hashSets)
{
var list = new Dictionary<uint, FileHashDetails>();
foreach (var hashSet in hashSets)
list[hashSet.FileSize] = hashSet;
List = list;
}
public FileHashDetails? GetFile(string nameData)
{
return List.Values.FirstOrDefault(z => z.FileName == nameData);
}
}
}