@@ -42,20 +42,20 @@ public static void SetEmpty(this Chest chest)
4242 chest . item [ i ] = new Item ( ) ;
4343 }
4444 }
45- public static Detour GetNameDetour ( Type targetMethodDeclaringType , Delegate replaceMethod , bool manualApply = true ) => new Detour ( targetMethodDeclaringType . GetMethod ( replaceMethod . Method . Name ) , replaceMethod . Method , new DetourConfig ( ) { ManualApply = manualApply } ) ;
46- public static Detour GetNameDetour ( Type targetMethodDeclaringType , MethodInfo replaceMethod , bool manualApply = true ) => new Detour ( targetMethodDeclaringType . GetMethod ( replaceMethod . Name ) , replaceMethod , new DetourConfig ( ) { ManualApply = manualApply } ) ;
47- public static Detour GetDetour ( Delegate method , bool manualApply = true )
45+ public static Hook GetNameDetour ( Type targetMethodDeclaringType , Delegate replaceMethod , bool manualApply = true ) => new Hook ( targetMethodDeclaringType . GetMethod ( replaceMethod . Method . Name ) , replaceMethod . Method ) ;
46+ public static Hook GetNameDetour ( Type targetMethodDeclaringType , MethodInfo replaceMethod , bool manualApply = true ) => new Hook ( targetMethodDeclaringType . GetMethod ( replaceMethod . Name ) , replaceMethod ) ;
47+ public static Hook GetDetour ( Delegate method , bool manualApply = true )
4848 {
4949 return GetNameDetour ( method . Method . DeclaringType ! . GetCustomAttribute < ReplaceTypeAttribute > ( ) ! . Type , method , manualApply ) ;
5050 }
51- public static Detour GetParamDetour ( Delegate method , bool manualApply = true )
51+ public static Hook GetParamDetour ( Delegate method , bool manualApply = true )
5252 {
5353 var methodType = method . Method . DeclaringType ! . GetCustomAttribute < ReplaceTypeAttribute > ( ) ! . Type ;
54- return new Detour ( methodType . GetMethod ( method . Method . Name , method . Method . GetParameters ( ) . Select ( x => x . ParameterType ) . ToArray ( ) ) , method . Method , new DetourConfig ( ) { ManualApply = manualApply } ) ;
54+ return new Hook ( methodType . GetMethod ( method . Method . Name , method . Method . GetParameters ( ) . Select ( x => x . ParameterType ) . ToArray ( ) ) ! , method . Method ) ;
5555 }
56- public static Detour GetParamDetour ( Type targetMethodDeclaringType , MethodInfo method , bool manualApply = true )
56+ public static Hook GetParamDetour ( Type targetMethodDeclaringType , MethodInfo method , bool manualApply = true )
5757 {
58- return new Detour ( targetMethodDeclaringType . GetMethod ( method . Name , method . GetParameters ( ) . Select ( x => x . ParameterType ) . ToArray ( ) ) , method , new DetourConfig ( ) { ManualApply = manualApply } ) ;
58+ return new Hook ( targetMethodDeclaringType . GetMethod ( method . Name , method . GetParameters ( ) . Select ( x => x . ParameterType ) . ToArray ( ) ) ! , method ) ;
5959 }
6060 public static void Deconstruct ( this Chest chest , out int x , out int y )
6161 {
0 commit comments