PkmnLibRSharp/PkmnLibRSharp/FFI/StaticData/Libraries/TypeLibrary.cs

37 lines
1.9 KiB
C#

using System;
using System.Runtime.InteropServices;
using PkmnLibSharp.StaticData;
namespace PkmnLibSharp.FFI.StaticData.Libraries
{
internal static class TypeLibrary
{
[DllImport(Data.DllName, CallingConvention = CallingConvention.Cdecl, CharSet = CharSet.Ansi)]
internal static extern IntPtr type_library_new(ulong capacity);
[DllImport(Data.DllName, CallingConvention = CallingConvention.Cdecl, CharSet = CharSet.Ansi)]
internal static extern void type_library_drop(IntPtr ptr);
[DllImport(Data.DllName, CallingConvention = CallingConvention.Cdecl, CharSet = CharSet.Ansi)]
internal static extern TypeIdentifier type_library_get_type_id(IntPtr ptr, IntPtr name, IntPtr success);
[DllImport(Data.DllName, CallingConvention = CallingConvention.Cdecl, CharSet = CharSet.Ansi)]
internal static extern IntPtr type_library_get_type_name(IntPtr ptr, TypeIdentifier typeIdentifier,
IntPtr success);
[DllImport(Data.DllName, CallingConvention = CallingConvention.Cdecl, CharSet = CharSet.Ansi)]
internal static extern float type_library_get_single_effectiveness(IntPtr ptr, TypeIdentifier attacking,
TypeIdentifier defending);
[DllImport(Data.DllName, CallingConvention = CallingConvention.Cdecl, CharSet = CharSet.Ansi)]
internal static extern float type_library_get_effectiveness(IntPtr ptr, TypeIdentifier attacking,
IntPtr defending, ulong defendingLength);
[DllImport(Data.DllName, CallingConvention = CallingConvention.Cdecl, CharSet = CharSet.Ansi)]
internal static extern TypeIdentifier type_library_register_type(IntPtr ptr, IntPtr name);
[DllImport(Data.DllName, CallingConvention = CallingConvention.Cdecl, CharSet = CharSet.Ansi)]
internal static extern void type_library_set_effectiveness(IntPtr ptr, TypeIdentifier attacking,
TypeIdentifier defending, float effectiveness);
}
}