Ejemplo n.º 1
0
 internal static List <AttributePatch> GetPatchMethods(Type type)
 {
     return(AccessTools.GetDeclaredMethods(type)
            .Select(method => AttributePatch.Create(method))
            .Where(attributePatch => attributePatch != null)
            .ToList());
 }
Ejemplo n.º 2
0
            internal void AddPatch(AttributePatch patch)
            {
                switch (patch.type)
                {
                case HarmonyPatchType.Prefix:
                    prefixes.Add(patch.info);
                    break;

                case HarmonyPatchType.Postfix:
                    postfixes.Add(patch.info);
                    break;

                case HarmonyPatchType.Transpiler:
                    transpilers.Add(patch.info);
                    break;

                case HarmonyPatchType.Finalizer:
                    finalizers.Add(patch.info);
                    break;

                case HarmonyPatchType.ILManipulator:
                    ilmanipulators.Add(patch.info);
                    break;
                }
            }
Ejemplo n.º 3
0
 internal static List <AttributePatch> GetPatchMethods(Type type, bool collectIncomplete = false)
 {
     return(AccessTools.GetDeclaredMethods(type)
            .SelectMany(m => AttributePatch.Create(m, collectIncomplete))
            .Where(attributePatch => attributePatch is object)
            .ToList());
 }
Ejemplo n.º 4
0
        internal static List <AttributePatch> GetPatchMethods(Type type)
        {
            var harmonyPatchName = typeof(HarmonyPatch).FullName;

            return(AccessTools.GetDeclaredMethods(type)
                   .Select(method => AttributePatch.Create(method))
                   .Where(attributePatch => attributePatch != null)
                   .ToList());
        }