#include "../../src/Library/Natures/NatureLibrary.hpp"
#include "../Core.hpp"
using namespace PkmnLib::Library;

export NatureLibrary* PkmnLib_NatureLibrary_Construct(size_t initialCapacity) {
    return new NatureLibrary(initialCapacity);
}
export void PkmnLib_NatureLibrary_Destruct(const NatureLibrary* p) { delete p; }

export uint8_t PkmnLib_NatureLibrary_LoadNature(NatureLibrary* p, const char* name, const Nature* nature) {
    Try(p->LoadNature(Arbutils::CaseInsensitiveConstString(name), nature);)
}
export uint8_t PkmnLib_NatureLibrary_GetNatureByName(NatureLibrary* p, const char* name, const Nature*& out) {
    Try(out = p->GetNatureByName(Arbutils::CaseInsensitiveConstString(name)));
}

export const char* PkmnLib_NatureLibrary_GetRandomNatureName(NatureLibrary* p, Arbutils::Random* rand) {
    return p->GetRandomNatureName(rand).c_str();
}

export uint8_t PkmnLib_NatureLibrary_GetNatureName(NatureLibrary* p, const Nature* nature, const char*& out) {
    Try(out = p->GetNatureName(nature).c_str());
}