Updates needed for breaking change in how abilities work.
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
2021-11-15 12:47:02 +01:00
parent 46538092bf
commit 545e321018
14 changed files with 71 additions and 221 deletions

View File

@@ -3,27 +3,27 @@
#include "../Core.hpp"
using namespace PkmnLib::Library;
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 char* talents[], size_t talentsLength,
const char* secretTalents[], size_t secretTalentsLength,
const LearnableMoves* attacks, const char* flags[],
size_t flagsCount) {
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) {
std::unordered_set<uint32_t> conversedFlags(flagsCount);
for (size_t i = 0; i < flagsCount; i++) {
conversedFlags.insert(ArbUt::StringView::CalculateHash(flags[i]));
}
auto talentsWrapped = ArbUt::List<ArbUt::StringView>(talentsLength);
auto talentsWrapped = ArbUt::List<ArbUt::BorrowedPtr<const CreatureLib::Library::Talent>>(talentsLength);
for (size_t i = 0; i < talentsLength; i++) {
talentsWrapped.Append(ArbUt::StringView(talents[i]));
talentsWrapped.Append(talents[i]);
}
auto secretTalentsWrapped = ArbUt::List<ArbUt::StringView>(secretTalentsLength);
auto secretTalentsWrapped =
ArbUt::List<ArbUt::BorrowedPtr<const CreatureLib::Library::Talent>>(secretTalentsLength);
for (size_t i = 0; i < secretTalentsLength; i++) {
secretTalentsWrapped.Append(ArbUt::StringView(secretTalents[i]));
secretTalentsWrapped.Append(secretTalents[i]);
}
return new PokemonForme(ArbUt::StringView(name), height, weight, baseExperience,

View File

@@ -6,8 +6,9 @@ export uint8_t PkmnLib_PokemonLibrary_Construct(PokemonLibrary*& out, PkmnLib::L
SpeciesLibrary* species, MoveLibrary* moves, ItemLibrary* items,
CreatureLib::Library::GrowthRateLibrary* growthRates,
CreatureLib::Library::TypeLibrary* typeLibrary,
CreatureLib::Library::TalentLibrary* talentLibrary,
NatureLibrary* natures) {
Try(out = new PokemonLibrary(settings, species, moves, items, growthRates, typeLibrary, natures));
Try(out = new PokemonLibrary(settings, species, moves, items, growthRates, typeLibrary, talentLibrary, natures));
}
export void PkmnLib_PokemonLibrary_Destruct(const PokemonLibrary* p) { delete p; }