Implements Pokemon stat calculation.
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
2020-01-05 15:18:30 +01:00
parent 02ab4b3272
commit 191b128125
12 changed files with 323 additions and 31 deletions

View File

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