-
Notifications
You must be signed in to change notification settings - Fork 5
/
Calculator.cs
41 lines (40 loc) · 1.91 KB
/
Calculator.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
using System;
namespace Calculator
{
public class Calculator
{
/// <summary>
/// Called by the CoreHook native host module to initialize the plugin with user-defined arguments.
/// </summary>
/// <param name="remoteParameters">A pointer containing information about the plugin to initialize.</param>
public static void Load(IntPtr remoteParameters) => System.Diagnostics.Debug.WriteLine($"The pointer parameter was {remoteParameters.ToInt64():X16}.");
/// <summary>
/// Add <paramref name="a"/> to <paramref name="b"/>.
/// </summary>
/// <param name="a">An integer value</param>
/// <param name="b">An integer value</param>
/// <returns>The sum of <paramref name="a"/> and <paramref name="b"/>.</returns>
public static int Add(int a, int b) => a + b;
/// <summary>
/// Subtract <paramref name="a"/> from <paramref name="b"/>.
/// </summary>
/// <param name="a">An integer value</param>
/// <param name="b">An integer value</param>
/// <returns>The difference of <paramref name="b"/> and <paramref name="a"/>.</returns>
public static int Subtract(int a, int b) => b - a;
/// <summary>
/// Multiply <paramref name="a"/> by <paramref name="b"/>.
/// </summary>
/// <param name="a">The multiplicand</param>
/// <param name="b">The multiplier</param>
/// <returns><paramref name="a"/> times <paramref name="b"/>.</returns>
public static int Multiply(int a, int b) => a * b;
/// <summary>
/// Divide <paramref name="a"/> by <paramref name="b"/>.
/// </summary>
/// <param name="a">The dividend</param>
/// <param name="b">The divisor</param>
/// <returns>The quotient of <paramref name="a"/> and <paramref name="b"/>.</returns>
public static int Divide(int a, int b) => a / b;
}
}