Anvil
Anvil.Services.HookService Class Reference

An advanced service for hooking native NWN functions. More...

+ Inheritance diagram for Anvil.Services.HookService:
+ Collaboration diagram for Anvil.Services.HookService:

Public Member Functions

FunctionHook< T > RequestHook< T > (T handler, int order=HookOrder.Default)
 Requests a hook for a native function. More...
 
FunctionHook< T > RequestHook< T > (void *handler, int order=HookOrder.Default)
 Requests a hook for a native function. More...
 

Detailed Description

An advanced service for hooking native NWN functions.

Member Function Documentation

◆ RequestHook< T >() [1/2]

FunctionHook<T> Anvil.Services.HookService.RequestHook< T > ( handler,
int  order = HookOrder.Default 
)
inline

Requests a hook for a native function.

Parameters
handlerThe handler to be invoked when this function is called. Once hooked, the original function will not be called, and must be invoked manually via the returned object.
orderThe execution order for this hook. See the constants in HookOrder.
Template Parameters
TThe delegate type that identically matches the native function signature.
Returns
A wrapper object containing a delegate to the original function. The wrapped object can be disposed to release the hook.
Type Constraints
T :Delegate 

◆ RequestHook< T >() [2/2]

FunctionHook<T> Anvil.Services.HookService.RequestHook< T > ( void *  handler,
int  order = HookOrder.Default 
)
inline

Requests a hook for a native function.

Parameters
handlerA delegate pointer (delegate*) to be invoked when the original game function is called. Once hooked, the original function will not be called, and must be invoked manually via the returned object.
orderThe execution order for this hook. See the constants in HookOrder.
Template Parameters
TThe delegate type that identically matches the native function signature. Must have the NativeFunctionAttribute applied.
Returns
A wrapper object containing a delegate to the original function. The wrapped object can be disposed to release the hook.
Type Constraints
T :Delegate 

The documentation for this class was generated from the following file: