diff --git a/TarkovUniformAim/ClodanUtils/BaseRaidFinishedPatch.cs b/TarkovUniformAim/ClodanUtils/BaseRaidFinishedPatch.cs deleted file mode 100644 index 73698b3..0000000 --- a/TarkovUniformAim/ClodanUtils/BaseRaidFinishedPatch.cs +++ /dev/null @@ -1,24 +0,0 @@ -using Aki.Reflection.Patching; -using System; -using System.Reflection; - -namespace ClodanClientUtils -{ - /* - * Abstract class that can be extended to hook up to the Raid finish event - */ - public abstract class BaseRaidFinishedPatch : ModulePatch - { - protected static Type _targetType; - protected static MethodBase _method; - public BaseRaidFinishedPatch() : base() - { - _targetType = ReflectionUtils.FindFirstEftType("LocalGame"); - _method = ReflectionUtils.FindFirstTypeMethod(_targetType, "method_12"); - } - protected override MethodBase GetTargetMethod() - { - return _method; - } - } -} \ No newline at end of file diff --git a/TarkovUniformAim/ClodanUtils/BaseRaidStartupPatch.cs b/TarkovUniformAim/ClodanUtils/BaseRaidStartupPatch.cs deleted file mode 100644 index 7c5df0d..0000000 --- a/TarkovUniformAim/ClodanUtils/BaseRaidStartupPatch.cs +++ /dev/null @@ -1,24 +0,0 @@ -using Aki.Reflection.Patching; -using System; -using System.Reflection; - -namespace ClodanClientUtils -{ - /* - * Abstract class that can be extended to hook up to the Raid startup event after everything has been loaded - */ - public abstract class BaseRaidStartupPatch : ModulePatch - { - protected static Type _targetType; - protected static MethodBase _method; - public BaseRaidStartupPatch() : base() - { - _targetType = ReflectionUtils.FindFirstEftType("GameWorld"); - _method = ReflectionUtils.FindFirstTypeMethod(_targetType, "OnGameStarted"); - } - protected override MethodBase GetTargetMethod() - { - return _method; - } - } -} \ No newline at end of file diff --git a/TarkovUniformAim/ClodanUtils/ReflectionUtils.cs b/TarkovUniformAim/ClodanUtils/ReflectionUtils.cs deleted file mode 100644 index 33081d4..0000000 --- a/TarkovUniformAim/ClodanUtils/ReflectionUtils.cs +++ /dev/null @@ -1,92 +0,0 @@ -using System; -using System.Linq; -using System.Reflection; - -namespace ClodanClientUtils -{ - public static class ReflectionUtils - { - - private static readonly Func _any = (t) => true; - - public static Type[] FilterFindAnyType(string _name, string[] _namespaces = null, Func filter = null, bool _partialName = false) - { - filter = filter ?? _any; - return AppDomain.CurrentDomain - .GetAssemblies() - .SelectMany(assembly => - { - return assembly.GetTypes() - .Where(t => _namespaces == null || _namespaces.Contains(t.Namespace)) - .Where(t => - { - if (_partialName) - { - return t.Name.Contains(_name); - } - else - { - return t.Name.EqualsAndNotNull(_name); - } - }); - }).Where(filter) - .DistinctBy(t => t.GetHashCode()) - .ToArray(); - } - - public static Type[] FindAnyEftType(string _name, bool _partialName = false) - { - return FilterFindAnyType(_name: _name, _namespaces: new string[] { "EFT" }, _partialName: _partialName); - } - - public static Type[] FindAnyType(string _name, bool _partialName = false) - { - return FilterFindAnyType(_name: _name, _partialName: _partialName); - } - - public static Type FindFirstEftType(string _name, bool _partialName = false) - { - return FindAnyEftType(_name, _partialName).First(); - } - - public static Type FindFirstType(string _name, bool _partialName = false) - { - return FindAnyType(_name, _partialName).First(); - } - - public static MethodInfo[] FilterFindAllTypeMethod(Type type, Func filter = null, string _name = null, bool _partialName = false) - { - filter = filter ?? _any; - return type.GetMethods(BindingFlags.FlattenHierarchy | BindingFlags.Static | BindingFlags.NonPublic | BindingFlags.Public | BindingFlags.Instance).Where(m => - { - if (_name == null) - { - return true; - } - else - { - if (_partialName) - { - return m.Name.Contains(_name); - } - else - { - return m.Name.EqualsAndNotNull(_name); - } - } - }).Where(filter) - .DistinctBy(m => m.GetHashCode()) - .ToArray(); - } - - public static MethodInfo[] FindAllTypeMethods(Type type, string _name = null, bool _partialName = false) - { - return FilterFindAllTypeMethod(type: type, _name: _name, _partialName: _partialName); - } - - public static MethodInfo FindFirstTypeMethod(Type type, string _name, bool _partialName = false) - { - return FindAllTypeMethods(type, _name, _partialName).First(); - } - } -}