2020-04-26 18:01:11 +00:00
|
|
|
#include "../../src/Battling/Battle/Battle.hpp"
|
|
|
|
#include "../Core.hpp"
|
|
|
|
using namespace PkmnLib::Battling;
|
|
|
|
|
|
|
|
export uint8_t PkmnLib_Battle_Construct(Battle*& out, const BattleLibrary* library,
|
|
|
|
CreatureLib::Battling::BattleParty* const* parties, size_t partiesCount,
|
2020-07-26 09:02:54 +00:00
|
|
|
bool canFlee, uint8_t numberOfSides, uint8_t creaturesPerSide,
|
|
|
|
uint_fast32_t randomSeed) {
|
2020-05-27 15:26:25 +00:00
|
|
|
ArbUt::List<CreatureLib::Battling::BattleParty*> partiesList(parties, parties + partiesCount);
|
2020-07-26 09:02:54 +00:00
|
|
|
Try(out = new Battle(library, partiesList, canFlee, numberOfSides, creaturesPerSide, randomSeed));
|
2020-04-26 18:01:11 +00:00
|
|
|
}
|
|
|
|
|
2020-12-28 14:11:06 +00:00
|
|
|
export void PkmnLib_Battle_Destruct(Battle* p) { p->~Battle(); }
|
2020-07-04 13:50:30 +00:00
|
|
|
export uint8_t PkmnLib_Battle_SetWeather(Battle* p, const char* name) { Try(p->SetWeather(ArbUt::StringView(name))); };
|
2020-04-26 18:01:11 +00:00
|
|
|
export uint8_t PkmnLib_Battle_ClearWeather(Battle* p) { Try(p->ClearWeather()); };
|
|
|
|
export const char* PkmnLib_Battle_GetWeatherName(Battle* p) { return p->GetWeatherName().c_str(); }
|