Got at least one data fetching method working; turns out, we can't use a patched LogicStack to get the data

This commit is contained in:
2026-01-14 22:11:11 +01:00
parent 40a8431464
commit 3f7122d30a
350 changed files with 41444 additions and 119 deletions

29
Utils/Extensions.cs Normal file
View File

@@ -0,0 +1,29 @@
using System;
using System.Collections.Generic;
using Assets.Scripts;
using Swan;
namespace RemoteControl.Utils
{
internal static class Extensions
{
internal static Dictionary<string, TEnum> AsLookupDict<TEnum, TValue>(this EnumCollection<TEnum, TValue> collection, bool lowercase)
where TEnum : Enum, IConvertible, new()
where TValue : IConvertible, IEquatable<TValue>
{
var result = new Dictionary<string, TEnum>();
for (var i = 0; i < collection.Length; i++)
{
var name = collection.Names[i];
if (lowercase)
{
name = name.ToLowerInvariant();
}
var value = collection.Values[i];
result.Add(name, value);
result.Add(collection.ValuesAsInts[i].ToStringInvariant(), value);
}
return result;
}
}
}