PkmnLib/CInterface/Library/SpeciesLibrary.cpp

14 lines
590 B
C++
Raw Normal View History

#include "../../src/Library/Species/SpeciesLibrary.hpp"
#include "../Core.hpp"
using namespace PkmnLib::Library;
2022-04-02 11:03:11 +00:00
export_func const SpeciesLibrary* PkmnLib_SpeciesLibrary_Construct(size_t initialCapacity) {
return new SpeciesLibrary(initialCapacity);
};
2022-04-02 11:03:11 +00:00
export_func u8 PkmnLib_SpeciesLibrary_FindPreEvolution(const PokemonSpecies*& out, const SpeciesLibrary* p,
2021-07-09 12:36:14 +00:00
const PokemonSpecies* species) {
Try(
auto v = p->FindPreEvolution(species);
2021-07-09 12:36:14 +00:00
if (!v.has_value()) { out = nullptr; } else { out = v.value().GetRaw(); })
}