59 lines
2.7 KiB
C#
59 lines
2.7 KiB
C#
using System;
|
|
using System.Runtime.InteropServices;
|
|
using PkmnLibSharp.StaticData;
|
|
using PkmnLibSharp.Utils;
|
|
|
|
namespace PkmnLibSharp.FFI.DynamicData
|
|
{
|
|
internal static class PokemonParty
|
|
{
|
|
/// <summary>
|
|
/// Instantiates a party with a set size.
|
|
/// </summary>
|
|
[DllImport(Data.DllName, CallingConvention = CallingConvention.Cdecl, CharSet = CharSet.Ansi)]
|
|
internal static extern FFIHandleValue pokemon_party_new(ulong capacity);
|
|
|
|
/// <summary>
|
|
/// Gets a Pokemon at an index in the party.
|
|
/// </summary>
|
|
[DllImport(Data.DllName, CallingConvention = CallingConvention.Cdecl, CharSet = CharSet.Ansi)]
|
|
internal static extern FFIHandleValue pokemon_party_at(FFIHandleValue party, ulong index);
|
|
|
|
/// <summary>
|
|
/// Swaps two Pokemon in the party around.
|
|
/// </summary>
|
|
[DllImport(Data.DllName, CallingConvention = CallingConvention.Cdecl, CharSet = CharSet.Ansi)]
|
|
internal static extern NativeResult pokemon_party_switch(FFIHandle party, ulong a, ulong b);
|
|
|
|
/// <summary>
|
|
/// Sets the Pokemon at an index to a Pokemon, returning the old Pokemon.
|
|
/// </summary>
|
|
[DllImport(Data.DllName, CallingConvention = CallingConvention.Cdecl, CharSet = CharSet.Ansi)]
|
|
internal static extern NativeResult<FFIHandleValue> pokemon_party_swap_into(FFIHandleValue party, ulong index,
|
|
FFIHandleValue pokemon);
|
|
|
|
/// <summary>
|
|
/// Whether or not the party still has Pokemon that can be used in battle.
|
|
/// </summary>
|
|
[DllImport(Data.DllName, CallingConvention = CallingConvention.Cdecl, CharSet = CharSet.Ansi)]
|
|
internal static extern byte pokemon_party_has_usable_pokemon(FFIHandleValue party);
|
|
|
|
/// <summary>
|
|
/// Get the length of the underlying list of Pokemon.
|
|
/// </summary>
|
|
[DllImport(Data.DllName, CallingConvention = CallingConvention.Cdecl, CharSet = CharSet.Ansi)]
|
|
internal static extern ulong pokemon_party_length(FFIHandleValue party);
|
|
|
|
/// <summary>
|
|
/// Makes sure there are no empty spots in the party anymore, leaving the length the same.
|
|
/// </summary>
|
|
[DllImport(Data.DllName, CallingConvention = CallingConvention.Cdecl, CharSet = CharSet.Ansi)]
|
|
internal static extern NativeResult pokemon_party_pack_party(FFIHandleValue party);
|
|
|
|
/// <summary>
|
|
/// Checks if the party contains a given pokemon.
|
|
/// </summary>
|
|
[DllImport(Data.DllName, CallingConvention = CallingConvention.Cdecl, CharSet = CharSet.Ansi)]
|
|
internal static extern byte pokemon_party_has_pokemon(FFIHandleValue party, FFIHandleValue pokemon);
|
|
}
|
|
} |