Add support for creating pokemon with passed Random parameter.
continuous-integration/drone/push Build is failing Details

This commit is contained in:
Deukhoofd 2021-04-11 17:50:47 +02:00
parent a88719e2b3
commit e8b86a20d1
Signed by: Deukhoofd
GPG Key ID: F63E044490819F6F
3 changed files with 7 additions and 5 deletions

View File

@ -34,9 +34,7 @@ namespace PkmnLib::Battling {
return *this; return *this;
} }
Pokemon* CreatePokemon::Build() { Pokemon* CreatePokemon::Build(ArbUt::Random& rand) {
auto rand = ArbUt::Random();
auto species = this->_library->GetSpeciesLibrary()->TryGet(this->_species); auto species = this->_library->GetSpeciesLibrary()->TryGet(this->_species);
if (!species.has_value()) { if (!species.has_value()) {
std::stringstream err; std::stringstream err;

View File

@ -67,7 +67,11 @@ namespace PkmnLib::Battling {
CreatePokemon& WithNature(const ArbUt::StringView& nature); CreatePokemon& WithNature(const ArbUt::StringView& nature);
CreatePokemon& IsAllowedExperienceGain(bool value); CreatePokemon& IsAllowedExperienceGain(bool value);
Pokemon* Build(); Pokemon* Build() {
auto rand = ArbUt::Random();
return Build(rand);
}
Pokemon* Build(ArbUt::Random& rand);
}; };
} }