Adds bind

This commit is contained in:
2025-01-26 10:48:13 +01:00
parent 83b316ad53
commit 802481c1f5
7 changed files with 116 additions and 2 deletions

View File

@@ -0,0 +1,11 @@
namespace PkmnLib.Static.Utils;
public static class DictionaryHelpers
{
public static TValue GetOrDefault<TKey, TValue>(this IDictionary<TKey, TValue> dictionary, TKey key, TValue defaultValue)
{
if (dictionary.TryGetValue(key, out var value))
return value;
return defaultValue;
}
}