diff --git a/PkmnLibSharp/Battling/BattleParty.cs b/PkmnLibSharp/Battling/BattleParty.cs new file mode 100644 index 0000000..d838138 --- /dev/null +++ b/PkmnLibSharp/Battling/BattleParty.cs @@ -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); + } + } +} \ No newline at end of file