2020-07-26 12:47:56 +00:00
|
|
|
using System;
|
|
|
|
using PkmnLibSharp.Utilities;
|
|
|
|
|
|
|
|
namespace PkmnLibSharp.Battling.ChoiceTurn
|
|
|
|
{
|
|
|
|
public abstract class BaseTurnChoice : PointerWrapper
|
|
|
|
{
|
|
|
|
protected BaseTurnChoice(IntPtr ptr) : base(ptr){}
|
|
|
|
|
2020-07-31 12:19:21 +00:00
|
|
|
public TurnChoiceKind Kind => (TurnChoiceKind) Creaturelib.Generated.BaseTurnChoice.GetKind(Ptr);
|
2020-07-26 12:47:56 +00:00
|
|
|
|
|
|
|
public Pokemon User
|
|
|
|
{
|
|
|
|
get
|
|
|
|
{
|
|
|
|
if (_user != null) return _user;
|
2020-07-31 12:19:21 +00:00
|
|
|
var ptr = Creaturelib.Generated.BaseTurnChoice.GetUser(Ptr);
|
2020-07-26 12:47:56 +00:00
|
|
|
if (TryResolvePointer(ptr, out _user))
|
2020-08-08 12:32:27 +00:00
|
|
|
return _user!;
|
2020-07-26 12:47:56 +00:00
|
|
|
_user = new Pokemon(ptr);
|
|
|
|
return _user;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2020-08-08 12:32:27 +00:00
|
|
|
private Pokemon? _user;
|
2020-07-26 12:47:56 +00:00
|
|
|
}
|
|
|
|
}
|