Add support for creating pokemon with passed Random parameter.
continuous-integration/drone/push Build is failing
Details
continuous-integration/drone/push Build is failing
Details
This commit is contained in:
parent
a88719e2b3
commit
e8b86a20d1
|
@ -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;
|
||||||
|
|
|
@ -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);
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue