2020-08-11 19:46:22 +00:00
|
|
|
#include "../../src/Library/Species/SpeciesLibrary.hpp"
|
|
|
|
#include "../Core.hpp"
|
|
|
|
using namespace PkmnLib::Library;
|
|
|
|
|
2021-06-26 11:36:21 +00:00
|
|
|
export const SpeciesLibrary* PkmnLib_SpeciesLibrary_Construct(size_t initialCapacity) {
|
|
|
|
return new SpeciesLibrary(initialCapacity);
|
|
|
|
};
|
|
|
|
|
|
|
|
export u8 PkmnLib_SpeciesLibrary_FindPreEvolution(const PokemonSpecies*& out, const SpeciesLibrary* p,
|
2020-08-11 19:46:22 +00:00
|
|
|
const PokemonSpecies* species) {
|
2021-06-26 11:36:21 +00:00
|
|
|
Try(
|
|
|
|
auto v = p->FindPreEvolution(species);
|
2021-06-26 15:07:09 +00:00
|
|
|
if (!v.has_value()){
|
2021-06-26 11:36:21 +00:00
|
|
|
out = nullptr;
|
2021-06-26 15:07:09 +00:00
|
|
|
} else {
|
|
|
|
out = v.value().GetRaw();
|
|
|
|
}
|
2021-06-26 11:36:21 +00:00
|
|
|
)
|
2020-08-11 19:46:22 +00:00
|
|
|
}
|