Adds ChangeStatBoostEvent, fixes issue where ExecutingMove would create default LearnedMove, instead of potential inheritor.
parent
d38338ddc3
commit
9f30f411cc
@ -0,0 +1,37 @@
|
||||
using System;
|
||||
using PkmnLibSharp.Utilities;
|
||||
using Statistic = PkmnLibSharp.Library.Statistic;
|
||||
|
||||
namespace PkmnLibSharp.Battling.Events
|
||||
{
|
||||
public class ChangeStatBoostEvent : EventData
|
||||
{
|
||||
internal ChangeStatBoostEvent(EventDataKind kind, IntPtr ptr) : base(kind, ptr)
|
||||
{
|
||||
}
|
||||
|
||||
public Pokemon Pokemon
|
||||
{
|
||||
get
|
||||
{
|
||||
if (_pokemon != null) return _pokemon;
|
||||
var ptr = Creaturelib.Generated.ChangeStatBoostEvent.GetCreature(Ptr);
|
||||
if (TryResolvePointer(ptr, out _pokemon))
|
||||
return _pokemon!;
|
||||
_pokemon = Constructor.Active.ConstructPokemon(ptr)!;
|
||||
return _pokemon;
|
||||
}
|
||||
}
|
||||
|
||||
public Statistic Statistic => (Statistic) Creaturelib.Generated.ChangeStatBoostEvent.GetStatistic(Ptr);
|
||||
public sbyte OldValue => Creaturelib.Generated.ChangeStatBoostEvent.GetOldValue(Ptr);
|
||||
public sbyte NewValue => Creaturelib.Generated.ChangeStatBoostEvent.GetNewValue(Ptr);
|
||||
|
||||
|
||||
private Pokemon? _pokemon;
|
||||
protected override void DeletePtr()
|
||||
{
|
||||
Creaturelib.Generated.ChangeStatBoostEvent.Destruct(Ptr);
|
||||
}
|
||||
}
|
||||
}
|
@ -0,0 +1,35 @@
|
||||
// AUTOMATICALLY GENERATED, DO NOT EDIT
|
||||
using System;
|
||||
using System.Runtime.InteropServices;
|
||||
|
||||
namespace Creaturelib.Generated
|
||||
{
|
||||
internal static class ChangeStatBoostEvent
|
||||
{
|
||||
/// <param name="p">const ChangeStatBoostEvent *</param>
|
||||
/// <returns>const Creature *</returns>
|
||||
[DllImport("libCreatureLib", CallingConvention = CallingConvention.Cdecl, EntryPoint= "CreatureLib_ChangeStatBoostEvent_GetCreature")]
|
||||
internal static extern IntPtr GetCreature(IntPtr p);
|
||||
|
||||
/// <param name="p">const ChangeStatBoostEvent *</param>
|
||||
/// <returns>Statistic</returns>
|
||||
[DllImport("libCreatureLib", CallingConvention = CallingConvention.Cdecl, EntryPoint= "CreatureLib_ChangeStatBoostEvent_GetStatistic")]
|
||||
internal static extern Statistic GetStatistic(IntPtr p);
|
||||
|
||||
/// <param name="p">const ChangeStatBoostEvent *</param>
|
||||
/// <returns>signed char</returns>
|
||||
[DllImport("libCreatureLib", CallingConvention = CallingConvention.Cdecl, EntryPoint= "CreatureLib_ChangeStatBoostEvent_GetOldValue")]
|
||||
internal static extern sbyte GetOldValue(IntPtr p);
|
||||
|
||||
/// <param name="p">const ChangeStatBoostEvent *</param>
|
||||
/// <returns>signed char</returns>
|
||||
[DllImport("libCreatureLib", CallingConvention = CallingConvention.Cdecl, EntryPoint= "CreatureLib_ChangeStatBoostEvent_GetNewValue")]
|
||||
internal static extern sbyte GetNewValue(IntPtr p);
|
||||
|
||||
/// <param name="p">const ChangeStatBoostEvent *</param>
|
||||
/// <returns>void</returns>
|
||||
[DllImport("libCreatureLib", CallingConvention = CallingConvention.Cdecl, EntryPoint= "CreatureLib_ChangeStatBoostEvent_Destruct")]
|
||||
internal static extern void Destruct(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.
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
Loading…
Reference in New Issue