CreatureLib/CInterface/Battling/CreatureParty.cpp

30 lines
1.4 KiB
C++
Raw Normal View History

#include "../../src/Battling/Models/CreatureParty.hpp"
#include "../Core.hpp"
using namespace CreatureLib::Battling;
2022-04-02 10:33:26 +00:00
export_func CreatureParty* CreatureLib_CreatureParty_ConstructWithSize(size_t size) { return new CreatureParty(size); }
export_func CreatureParty* CreatureLib_CreatureParty_ConstructFromArray(Creature* creatures[], size_t size) {
2020-05-26 16:31:06 +00:00
return new CreatureParty(ArbUt::List<Creature*>(creatures, creatures + size));
}
2022-04-02 10:33:26 +00:00
export_func void CreatureLib_CreatureParty_Destruct(const CreatureParty* p) { delete p; }
2022-04-02 10:33:26 +00:00
export_func u8 CreatureLib_CreatureParty_GetAtIndex(Creature*& out, const CreatureParty* p, size_t index) {
Try(out = p->GetAtIndex(index).GetValue();)
}
2022-04-02 10:33:26 +00:00
export_func u8 CreatureLib_CreatureParty_Switch(CreatureParty* p, size_t a, size_t b) { Try(p->Switch(a, b);) }
export_func u8 CreatureLib_CreatureParty_PackParty(CreatureParty* p) { Try(p->PackParty();) }
2022-04-02 10:33:26 +00:00
export_func u8 CreatureLib_CreatureParty_SwapInto(Creature*& out, CreatureParty* p, size_t index, Creature* creature) {
Try(out = p->SwapInto(index, creature);)
}
2022-04-02 10:33:26 +00:00
export_func bool CreatureLib_CreatureParty_HasAvailableCreatures(const CreatureParty* p) {
return p->HasAvailableCreatures();
}
2022-04-02 10:33:26 +00:00
export_func size_t CreatureLib_CreatureParty_GetLength(const CreatureParty* p) { return p->GetLength(); }
2022-04-02 10:33:26 +00:00
export_func Creature* const* CreatureLib_CreatureParty_GetParty(CreatureParty* p) { return p->GetParty().RawData(); }