CreatureLib/CInterface/Battling/BattleSide.cpp

40 lines
1.7 KiB
C++

#include "../../src/Battling/Models/BattleSide.hpp"
#include "../Core.hpp"
using namespace CreatureLib::Battling;
export BattleSide* CreatureLib_BattleSide_Construct(uint8_t index, Battle* battle, uint8_t creaturesPerSide) {
return new BattleSide(index, battle, creaturesPerSide);
}
export void CreatureLib_BattleSide_Destruct(BattleSide* p) { delete p; }
export bool CreatureLib_BattleSide_AllChoicesSet(BattleSide* p) { return p->AllChoicesSet(); }
export uint8_t CreatureLib_BattleSide_AllPossibleSlotsFilled(bool& out, BattleSide* p) {
Try(out = p->AllPossibleSlotsFilled());
}
export uint8_t CreatureLib_BattleSide_SetChoice(BattleSide* p, BaseTurnChoice* choice) { Try(p->SetChoice(choice);) }
export void CreatureLib_BattleSide_ResetChoices(BattleSide* p) { p->ResetChoices(); }
export uint8_t CreatureLib_BattleSide_SetCreature(BattleSide* p, Creature* creature, uint8_t index) {
Try(p->SetCreature(creature, index));
}
export uint8_t CreatureLib_BattleSide_GetCreature(Creature*& out, BattleSide* p, uint8_t index) {
Try(out = p->GetCreature(index).GetValue());
}
export uint8_t CreatureLib_BattleSide_GetSideIndex(BattleSide* p) { return p->GetSideIndex(); }
export uint8_t CreatureLib_BattleSide_GetCreatureIndex(uint8_t& out, BattleSide* p, Creature* c) {
Try(out = p->GetCreatureIndex(c));
}
export uint8_t CreatureLib_BattleSide_MarkSlotAsUnfillable(BattleSide* p, Creature* c) {
Try(p->MarkSlotAsUnfillable(c));
}
export bool CreatureLib_BattleSide_IsDefeated(BattleSide* p) { return p->IsDefeated(); }
export bool CreatureLib_BattleSide_HasFled(BattleSide* p) { return p->HasFled(); }
export void CreatureLib_BattleSide_MarkAsFled(BattleSide* p) { p->MarkAsFled(); }