Reworks nature library to be simpler.
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
2020-04-17 18:20:48 +02:00
parent 94980ef7ab
commit 086438f547
9 changed files with 41 additions and 116 deletions

View File

@@ -1,8 +1,4 @@
#include "Pokemon.hpp"
const PkmnLib::Library::Nature& PkmnLib::Battling::Pokemon::GetNature() const{
if (_natureCache == nullptr){
auto p = const_cast<Pokemon*>(this);
p->_natureCache = this->GetLibrary()->GetNatureLibrary()->GetNaturePtr(_nature);
}
return *_natureCache;
return this->GetLibrary()->GetNatureLibrary()->GetNatureByName(_nature);
}