Files
SPT-Server-Build/Core/Utils/Extensions/ObjectExtensions.cs
T
2025-01-17 22:37:40 +00:00

24 lines
596 B
C#

using Core.Models.Spt.Repeatable;
namespace Core.Utils.Extensions
{
public static class ObjectExtensions
{
public static bool Contains<T>(this object obj, T key)
{
return obj.GetType().GetProperties().Any(x => x.Name == key.ToString());
}
public static T? Get<T>(this object obj, string toLower)
{
return (T?)obj.GetType().GetProperties().SingleOrDefault(p => p.GetJsonName() == toLower)?.GetValue(obj);
}
public static void Remove<T>(this EliminationTargetPool pool, T key)
{
}
}
}