PkmnLib/CInterface/Battling/Battle.cpp

18 lines
1.1 KiB
C++

#include "../../src/Battling/Battle/Battle.hpp"
#include "../Core.hpp"
using namespace PkmnLib::Battling;
export_func uint8_t PkmnLib_Battle_Construct(Battle*& out, const BattleLibrary* library,
CreatureLib::Battling::BattleParty* const* parties, size_t partiesCount,
bool canFlee, uint8_t numberOfSides, uint8_t creaturesPerSide,
uint_fast32_t randomSeed) {
ArbUt::List<CreatureLib::Battling::BattleParty*> partiesList(parties, parties + partiesCount);
Try(out = new Battle(library, partiesList, canFlee, numberOfSides, creaturesPerSide, randomSeed));
}
export_func void PkmnLib_Battle_Destruct(Battle* p) { p->~Battle(); }
export_func uint8_t PkmnLib_Battle_SetWeather(Battle* p, const char* name) {
Try(p->SetWeather(ArbUt::StringView(name)));
};
export_func uint8_t PkmnLib_Battle_ClearWeather(Battle* p) { Try(p->ClearWeather()); };
export_func const char* PkmnLib_Battle_GetWeatherName(Battle* p) { return p->GetWeatherName().c_str(); }