add: Patchable items and frames
This commit is contained in:
21
src/Resources/FramePatches/Generic/DictionaryFramePatch.cs
Normal file
21
src/Resources/FramePatches/Generic/DictionaryFramePatch.cs
Normal file
@@ -0,0 +1,21 @@
|
||||
|
||||
namespace Polonium.Resources.FramePatches.Generic;
|
||||
|
||||
public abstract partial class DictionaryFramePatch<TKey, TValue> : FramePatch
|
||||
{
|
||||
public Dictionary<TKey, TValue> Updates { get; set; } = new ();
|
||||
|
||||
public Dictionary<TKey, TValue> Filter(HashSet<TKey> filter)
|
||||
{
|
||||
Dictionary<TKey, TValue> res = new();
|
||||
foreach (TKey key in filter)
|
||||
{
|
||||
if (!Updates.ContainsKey(key))
|
||||
continue;
|
||||
res[key] = Updates[key];
|
||||
}
|
||||
|
||||
return res;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user