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;
|
||||
}
|
||||
|
||||
Pokemon* CreatePokemon::Build() {
|
||||
auto rand = ArbUt::Random();
|
||||
|
||||
Pokemon* CreatePokemon::Build(ArbUt::Random& rand) {
|
||||
auto species = this->_library->GetSpeciesLibrary()->TryGet(this->_species);
|
||||
if (!species.has_value()) {
|
||||
std::stringstream err;
|
||||
|
|
|
@ -67,7 +67,11 @@ namespace PkmnLib::Battling {
|
|||
CreatePokemon& WithNature(const ArbUt::StringView& nature);
|
||||
CreatePokemon& IsAllowedExperienceGain(bool value);
|
||||
|
||||
Pokemon* Build();
|
||||
Pokemon* Build() {
|
||||
auto rand = ArbUt::Random();
|
||||
return Build(rand);
|
||||
}
|
||||
Pokemon* Build(ArbUt::Random& rand);
|
||||
};
|
||||
}
|
||||
|
||||
|
|
|
@ -304,7 +304,7 @@ void AngelScriptScript::ModifyNumberOfHits(CreatureLib::Battling::AttackTurnChoi
|
|||
CreatureLib::Battling::BattleScript* AngelScriptScript::Clone() {
|
||||
auto* ctx = _ctxPool->RequestContext();
|
||||
auto* obj = _type->Instantiate(ctx);
|
||||
if (_obj != nullptr){
|
||||
if (_obj != nullptr) {
|
||||
obj->CopyFrom(_obj);
|
||||
}
|
||||
_ctxPool->ReturnContextToPool(ctx);
|
||||
|
|
Loading…
Reference in New Issue