using System.Runtime.InteropServices;
using System;
namespace ToasterMap
{
static class ToasterMap
{
public static String tbinPath;
[UnmanagedCallersOnly(EntryPoint = "add")]
public static int Add(int a, int b) => a + b;
[UnmanagedCallersOnly(EntryPoint = "init")]
public static void Init(string tbinPath)
{
if (!File.Exists(tbinPath))
{
throw new Exception("TBin path does not exist");
}
ToasterMap.tbinPath = tbinPath;
}
}
}
using System.Runtime.InteropServices;
using System;
namespace ToasterMap
{
static class ToasterMap
{
public static String tbinPath;
[UnmanagedCallersOnly(EntryPoint = "add")]
public static int Add(int a, int b) => a + b;
[UnmanagedCallersOnly(EntryPoint = "init")]
public static void Init(string tbinPath)
{
if (!File.Exists(tbinPath))
{
throw new Exception("TBin path does not exist");
}
ToasterMap.tbinPath = tbinPath;
}
}
}