Adds ItemTurnChoice interface
continuous-integration/drone/push Build is passing
Details
continuous-integration/drone/push Build is passing
Details
parent
61e48a705a
commit
907e145083
@ -0,0 +1,40 @@
|
||||
using System;
|
||||
using PkmnLibSharp.Battling.ChoiceTurn;
|
||||
using PkmnLibSharp.Library.Items;
|
||||
|
||||
namespace PkmnLibSharp.Battling
|
||||
{
|
||||
public class ItemTurnChoice : BaseTurnChoice
|
||||
{
|
||||
public ItemTurnChoice(Pokemon user, Item item) : base(
|
||||
Creaturelib.Generated.ItemTurnChoice.ConstructWithoutTarget(user.Ptr, item.Ptr))
|
||||
{
|
||||
}
|
||||
|
||||
public ItemTurnChoice(Pokemon user, Item item, byte targetSide, byte targetIndex) : base(
|
||||
Creaturelib.Generated.ItemTurnChoice.ConstructWithTarget(user.Ptr, item.Ptr, targetSide, targetIndex))
|
||||
{
|
||||
}
|
||||
|
||||
internal ItemTurnChoice(IntPtr ptr) : base(ptr){}
|
||||
|
||||
private Item? _item;
|
||||
public Item Item
|
||||
{
|
||||
get
|
||||
{
|
||||
if (_item != null) return _item;
|
||||
var ptr = Creaturelib.Generated.ItemTurnChoice.GetItem(Ptr);
|
||||
if (TryResolvePointer(ptr, out _item))
|
||||
return _item!;
|
||||
_item = new Item(ptr);
|
||||
return _item;
|
||||
}
|
||||
}
|
||||
|
||||
protected override void DeletePtr()
|
||||
{
|
||||
Creaturelib.Generated.ItemTurnChoice.Destruct(Ptr);
|
||||
}
|
||||
}
|
||||
}
|
@ -0,0 +1,39 @@
|
||||
// AUTOMATICALLY GENERATED, DO NOT EDIT
|
||||
using System;
|
||||
using System.Runtime.InteropServices;
|
||||
|
||||
namespace Creaturelib.Generated
|
||||
{
|
||||
internal static class ItemTurnChoice
|
||||
{
|
||||
/// <param name="user">Creature *</param>
|
||||
/// <param name="item">Item *</param>
|
||||
/// <returns>ItemTurnChoice *</returns>
|
||||
[DllImport("libCreatureLib", CallingConvention = CallingConvention.Cdecl, EntryPoint= "CreatureLib_ItemTurnChoice_ConstructWithoutTarget")]
|
||||
internal static extern IntPtr ConstructWithoutTarget(IntPtr user, IntPtr item);
|
||||
|
||||
/// <param name="user">Creature *</param>
|
||||
/// <param name="item">const Item *</param>
|
||||
/// <param name="targetSide">unsigned char</param>
|
||||
/// <param name="targetIndex">unsigned char</param>
|
||||
/// <returns>ItemTurnChoice *</returns>
|
||||
[DllImport("libCreatureLib", CallingConvention = CallingConvention.Cdecl, EntryPoint= "CreatureLib_ItemTurnChoice_ConstructWithTarget")]
|
||||
internal static extern IntPtr ConstructWithTarget(IntPtr user, IntPtr item, byte targetSide, byte targetIndex);
|
||||
|
||||
/// <param name="p">SwitchTurnChoice *</param>
|
||||
/// <returns>void</returns>
|
||||
[DllImport("libCreatureLib", CallingConvention = CallingConvention.Cdecl, EntryPoint= "CreatureLib_ItemTurnChoice_Destruct")]
|
||||
internal static extern void Destruct(IntPtr p);
|
||||
|
||||
/// <param name="p">const ItemTurnChoice *</param>
|
||||
/// <returns>TurnChoiceKind</returns>
|
||||
[DllImport("libCreatureLib", CallingConvention = CallingConvention.Cdecl, EntryPoint= "CreatureLib_ItemTurnChoice_GetKind")]
|
||||
internal static extern TurnChoiceKind GetKind(IntPtr p);
|
||||
|
||||
/// <param name="p">const ItemTurnChoice *</param>
|
||||
/// <returns>const Item *</returns>
|
||||
[DllImport("libCreatureLib", CallingConvention = CallingConvention.Cdecl, EntryPoint= "CreatureLib_ItemTurnChoice_GetItem")]
|
||||
internal static extern IntPtr GetItem(IntPtr p);
|
||||
|
||||
}
|
||||
}
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
File diff suppressed because one or more lines are too long
Loading…
Reference in New Issue