2020-03-08 14:19:19 +00:00
|
|
|
#include "../../src/Battling/Models/BattleParty.hpp"
|
2020-07-31 08:51:03 +00:00
|
|
|
#include "../Core.hpp"
|
2020-03-08 14:19:19 +00:00
|
|
|
using namespace CreatureLib::Battling;
|
|
|
|
|
|
|
|
// Note that creatureIndices should be twice the size of numberOfIndices, and have index of side, index of creature on
|
|
|
|
// side, one after the other.
|
2022-04-02 10:33:26 +00:00
|
|
|
export_func u8 CreatureLib_BattleParty_Construct(BattleParty*& out, CreatureParty* p, u8 creatureIndices[],
|
|
|
|
size_t numberOfIndices) {
|
2020-05-26 16:31:06 +00:00
|
|
|
Try(ArbUt::List<CreatureIndex> indices(numberOfIndices); for (size_t i = 0; i < numberOfIndices; i++) {
|
2020-07-26 13:29:16 +00:00
|
|
|
indices.Append(CreatureIndex(creatureIndices[i * 2], creatureIndices[i * 2 + 1]));
|
2020-05-26 16:31:06 +00:00
|
|
|
} out = new BattleParty(p, indices);)
|
2020-03-08 14:19:19 +00:00
|
|
|
}
|
|
|
|
|
2022-04-02 10:33:26 +00:00
|
|
|
export_func void CreatureLib_BattleParty_Destruct(const BattleParty* p) { delete p; }
|
2020-03-08 14:19:19 +00:00
|
|
|
|
2020-07-26 13:46:11 +00:00
|
|
|
BORROWED_GET_FUNC(BattleParty, GetParty, CreatureParty*);
|
2022-04-02 10:33:26 +00:00
|
|
|
export_func u8 CreatureLib_BattleParty_IsResponsibleForIndex(bool& out, const BattleParty* p, u8 side, u8 creature) {
|
2020-03-25 18:07:36 +00:00
|
|
|
Try(out = p->IsResponsibleForIndex(side, creature);)
|
2020-03-08 14:19:19 +00:00
|
|
|
}
|
2022-04-02 10:33:26 +00:00
|
|
|
export_func bool CreatureLib_BattleParty_HasCreaturesNotInField(const BattleParty* p) {
|
|
|
|
return p->HasCreaturesNotInField();
|
|
|
|
}
|