PkmnLibSharp/PkmnLibSharp/Battling/BattleParty.cs

33 lines
1.0 KiB
C#

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);
}
}
}