PkmnLib.NET/PkmnLib.Static/Utils/DictionaryHelpers.cs
2025-01-26 10:48:13 +01:00

11 lines
323 B
C#

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;
}
}