Terraria v1.4.4.9
Terraria source code documentation
Loading...
Searching...
No Matches
Helpers.cs
Go to the documentation of this file.
2
4
5internal static class Helpers
6{
7 internal static T CommonNode<T>(T first, T second, Func<T, T> parent) where T : class
8 {
10 if (@default.Equals(first, second))
11 {
12 return first;
13 }
14 HashSet<T> hashSet = new HashSet<T>(@default);
15 for (T val = first; val != null; val = parent(val))
16 {
17 hashSet.Add(val);
18 }
19 for (T val2 = second; val2 != null; val2 = parent(val2))
20 {
22 {
23 return val2;
24 }
25 }
26 return null;
27 }
28
29 internal static void IncrementCount<T>(T key, Dictionary<T, int> dict)
30 {
32 dict[key] = value + 1;
33 }
34}
bool TryGetValue(TKey key, [MaybeNullWhen(false)] out TValue value)
bool ICollection< KeyValuePair< TKey, TValue > >. Contains(KeyValuePair< TKey, TValue > keyValuePair)
void Add(TKey key, TValue value)
static T CommonNode< T >(T first, T second, Func< T, T > parent)
Definition Helpers.cs:7
static void IncrementCount< T >(T key, Dictionary< T, int > dict)
Definition Helpers.cs:29