NHSE/NHSE.Core/Hashing/FileHashInfo.cs
Kurt 6c40e1c769
Initial v1.7.0 Support (#445)
* Pre-patch preparations

* Update magic values

* Check formatting characters directly rather than string compare

"Brown".StartsWith("\u000e")
>true
what

let's be paranoid here, because .NET Core behaves differently from .NET framework.

* Update FileHashRevision.cs

Postbox with the massive decrease in size; likely the same mutation caused the other massive decreases.

* Dump item names

* Update flag definitions

* Update item info

* Add feathers to bug list

Might remove later.

* Update RecipeList.cs

* Update ItemRemakeUtil.cs

* Update stack details

* Update offsets

* Update MainSaveOffsets17.cs

* Update GameLists.cs
2021-01-27 20:04:51 -08:00

24 lines
631 B
C#

using System.Collections.Generic;
using System.Linq;
namespace NHSE.Core
{
public sealed class FileHashInfo
{
private readonly IReadOnlyDictionary<uint, FileHashDetails> List;
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);
}
}
}