2020-08-17 16:23:25 +00:00
|
|
|
#include "../../src/Library/Species/PokemonForme.hpp"
|
|
|
|
#include "../../src/Library/Species/LearnableMoves.hpp"
|
|
|
|
#include "../Core.hpp"
|
|
|
|
using namespace PkmnLib::Library;
|
|
|
|
|
2021-11-15 11:47:02 +00:00
|
|
|
export PokemonForme*
|
|
|
|
PkmnLib_PokemonForme_Construct(const char* name, float height, float weight, uint32_t baseExperience, uint8_t types[],
|
|
|
|
size_t typeLength, uint16_t baseHealth, uint16_t baseAttack, uint16_t baseDefense,
|
|
|
|
uint16_t baseMagicalAttack, uint16_t baseMagicalDefense, uint16_t baseSpeed,
|
|
|
|
const CreatureLib::Library::Talent* talents[], size_t talentsLength,
|
|
|
|
const CreatureLib::Library::Talent* secretTalents[], size_t secretTalentsLength,
|
|
|
|
const LearnableMoves* attacks, const char* flags[], size_t flagsCount) {
|
2020-08-17 16:23:25 +00:00
|
|
|
|
|
|
|
std::unordered_set<uint32_t> conversedFlags(flagsCount);
|
|
|
|
for (size_t i = 0; i < flagsCount; i++) {
|
|
|
|
conversedFlags.insert(ArbUt::StringView::CalculateHash(flags[i]));
|
|
|
|
}
|
|
|
|
|
2021-11-15 11:47:02 +00:00
|
|
|
auto talentsWrapped = ArbUt::List<ArbUt::BorrowedPtr<const CreatureLib::Library::Talent>>(talentsLength);
|
2020-08-17 16:23:25 +00:00
|
|
|
for (size_t i = 0; i < talentsLength; i++) {
|
2021-11-15 11:47:02 +00:00
|
|
|
talentsWrapped.Append(talents[i]);
|
2020-08-17 16:23:25 +00:00
|
|
|
}
|
2021-11-15 11:47:02 +00:00
|
|
|
auto secretTalentsWrapped =
|
|
|
|
ArbUt::List<ArbUt::BorrowedPtr<const CreatureLib::Library::Talent>>(secretTalentsLength);
|
2020-08-17 16:23:25 +00:00
|
|
|
for (size_t i = 0; i < secretTalentsLength; i++) {
|
2021-11-15 11:47:02 +00:00
|
|
|
secretTalentsWrapped.Append(secretTalents[i]);
|
2020-08-17 16:23:25 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
return new PokemonForme(ArbUt::StringView(name), height, weight, baseExperience,
|
|
|
|
ArbUt::List<uint8_t>(types, types + typeLength),
|
|
|
|
CreatureLib::Library::StatisticSet<uint16_t>(
|
|
|
|
baseHealth, baseAttack, baseDefense, baseMagicalAttack, baseMagicalDefense, baseSpeed),
|
|
|
|
talentsWrapped, secretTalentsWrapped, attacks, conversedFlags);
|
|
|
|
}
|