Insanely huge initial commit

This commit is contained in:
2026-02-21 16:40:15 -08:00
parent 2ba1c94b88
commit ee9aee0a1b
33825 changed files with 5213498 additions and 0 deletions

View File

@@ -0,0 +1,34 @@
using UnityEngine;
using System.Collections;
using System.Collections.Generic;
namespace MoreMountains.Tools
{
/// <summary>
/// Dictionary extensions
/// </summary>
public static class MMDictionaryExtensions
{
/// <summary>
/// Finds a key (if there's one) that matches the value set in parameters
/// </summary>
/// <typeparam name="T"></typeparam>
/// <typeparam name="W"></typeparam>
/// <param name="dictionary"></param>
/// <param name="value"></param>
/// <returns></returns>
public static T KeyByValue<T, W>(this Dictionary<T, W> dictionary, T value)
{
T key = default;
foreach (KeyValuePair<T, W> pair in dictionary)
{
if (pair.Value.Equals(value))
{
key = pair.Key;
break;
}
}
return key;
}
}
}