DictionaryExt.Add many

This commit is contained in:
Justin Swanson 2020-04-01 19:43:49 -05:00
parent a140b1daca
commit 820e2abf41

View File

@ -18,5 +18,21 @@ namespace Wabbajack
dict[key] = ret;
return ret;
}
public static void Add<K, V>(this IDictionary<K, V> dict, IEnumerable<KeyValuePair<K, V>> vals)
{
foreach (var val in vals)
{
dict.Add(val);
}
}
public static void Set<K, V>(this IDictionary<K, V> dict, IEnumerable<KeyValuePair<K, V>> vals)
{
foreach (var val in vals)
{
dict[val.Key] = val.Value;
}
}
}
}