32 lines
763 B
C#
32 lines
763 B
C#
using System;
|
|
|
|
namespace PkmnLibSharp.Battling.Events
|
|
{
|
|
public class FaintEvent : EventData
|
|
{
|
|
internal FaintEvent(EventDataKind kind, IntPtr ptr) : base(kind, ptr)
|
|
{
|
|
}
|
|
|
|
Pokemon Pokemon
|
|
{
|
|
get
|
|
{
|
|
if (_pokemon != null) return _pokemon;
|
|
var ptr = Creaturelib.Generated.DamageEvent.GetCreature(Ptr);
|
|
if (TryResolvePointer(ptr, out _pokemon))
|
|
return _pokemon;
|
|
_pokemon = new Pokemon(ptr);
|
|
return _pokemon;
|
|
|
|
}
|
|
}
|
|
|
|
private Pokemon _pokemon;
|
|
|
|
protected override void DeletePtr()
|
|
{
|
|
Creaturelib.Generated.FaintEvent.Destruct(Ptr);
|
|
}
|
|
}
|
|
} |