Adds WASM type registry for species and formes.
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
2022-05-21 20:46:04 +02:00
parent 5a545aaa98
commit 9adbd27358
9 changed files with 183 additions and 7 deletions

View File

@@ -12,10 +12,9 @@ namespace PkmnLib::Library {
ArbUt::List<ArbUt::StringView> _eggGroups;
public:
PokemonSpecies(u16 id, const ArbUt::StringView& name, const PokemonForme* non_null defaultForme, float genderRatio,
const ArbUt::StringView& growthRate, u8 captureRate, u8 baseHappiness,
const ArbUt::List<ArbUt::StringView>& eggGroups,
std::unordered_set<u32> flags = {}) noexcept
PokemonSpecies(u16 id, const ArbUt::StringView& name, const PokemonForme* non_null defaultForme,
float genderRatio, const ArbUt::StringView& growthRate, u8 captureRate, u8 baseHappiness,
const ArbUt::List<ArbUt::StringView>& eggGroups, std::unordered_set<u32> flags = {}) noexcept
: CreatureSpecies(id, name, defaultForme, genderRatio, growthRate, captureRate, flags),
_baseHappiness(baseHappiness), _eggGroups(eggGroups) {}
@@ -45,6 +44,14 @@ namespace PkmnLib::Library {
const ArbUt::UniquePtrList<const EvolutionData>& GetEvolutions() const noexcept { return _evolutions; }
bool HasEggGroup(const ArbUt::StringView& sv) const noexcept { return _eggGroups.Contains(sv); }
bool HasEggGroup(u32 hash) const noexcept {
for (auto& eg : _eggGroups) {
if (eg == hash) {
return true;
}
}
return false;
}
const ArbUt::List<ArbUt::StringView>& GetEggGroups() const noexcept { return _eggGroups; }
};
}