Пример #1
0
 public CalculatorTest()
 {
     _nativeCalculator = new NativeCalculator();
     _addFunction      = ReloadedHooks.Instance.CreateWrapper <NativeCalculator.AddFunction>((long)_nativeCalculator.Add, out _);
     _subtractFunction = ReloadedHooks.Instance.CreateWrapper <NativeCalculator.SubtractFunction>((long)_nativeCalculator.Subtract, out _);
     _divideFunction   = ReloadedHooks.Instance.CreateWrapper <NativeCalculator.DivideFunction>((long)_nativeCalculator.Divide, out _);
     _multiplyFunction = ReloadedHooks.Instance.CreateWrapper <NativeCalculator.MultiplyFunction>((long)_nativeCalculator.Multiply, out _);
 }
Пример #2
0
 public unsafe CalculatorHookTest()
 {
     _nativeCalculator      = new NativeCalculator();
     _addFunction           = ReloadedHooks.Instance.CreateWrapper <NativeCalculator.AddFunction>((long)_nativeCalculator.Add, out var addWrapper);
     _subtractFunction      = ReloadedHooks.Instance.CreateWrapper <NativeCalculator.SubtractFunction>((long)_nativeCalculator.Subtract, out _);
     _divideFunction        = ReloadedHooks.Instance.CreateWrapper <NativeCalculator.DivideFunction>((long)_nativeCalculator.Divide, out var divWrapper);
     _multiplyFunction      = ReloadedHooks.Instance.CreateWrapper <NativeCalculator.MultiplyFunction>((long)_nativeCalculator.Multiply, out var mulWrapper);
     _addWithBranchFunction = ReloadedHooks.Instance.CreateWrapper <NativeCalculator.AddFunction>((long)_nativeCalculator.AddWithBranch, out _);
 }