Support for BattleParty.

This commit is contained in:
Deukhoofd 2020-07-25 15:44:39 +02:00
parent d01e6a8df7
commit e2ecec8e7a
Signed by: Deukhoofd
GPG Key ID: F63E044490819F6F
1 changed files with 33 additions and 0 deletions

View File

@ -0,0 +1,33 @@
using System;
using PkmnLibSharp.Utilities;
namespace PkmnLibSharp.Battling
{
public class BattleParty : PointerWrapper
{
public BattleParty(PokemonParty party, byte[] responsibleIndices)
{
var ptr = IntPtr.Zero;
Creaturelibbattling.Generated.BattleParty.Construct(ref ptr, party.Ptr, responsibleIndices.ArrayPtr(),
(ulong) responsibleIndices.Length).Assert();
Initialize(ptr);
}
public bool IsResponsibleForIndex(byte side, byte index)
{
byte result = 0;
Creaturelibbattling.Generated.BattleParty.IsResponsibleForIndex(ref result, Ptr, side, index).Assert();
return result == 1;
}
public bool HasPokemonNotInField()
{
return Creaturelibbattling.Generated.BattleParty.HasCreaturesNotInField(Ptr) == 1;
}
protected override void DeletePtr()
{
Creaturelibbattling.Generated.BattleParty.Destruct(Ptr);
}
}
}