Update to new CreatureLib version, updated libraries in accordance.
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
2020-02-15 19:04:06 +01:00
parent 4ee791c6cb
commit 45662cb29b
14 changed files with 68 additions and 75 deletions

View File

@@ -40,7 +40,7 @@ PkmnLib::Battling::CreatePokemon* PkmnLib::Battling::CreatePokemon::WithEffortVa
PkmnLib::Battling::Pokemon* PkmnLib::Battling::CreatePokemon::Build() {
auto rand = CreatureLib::Core::Random();
const PkmnLib::Library::PokemonSpecies* species = nullptr;
if (!this->_library->GetSpeciesLibrary()->TryGetPkmnSpecies(this->_species, species)) {
if (!this->_library->GetSpeciesLibrary()->TryGet(this->_species.c_str(), species)) {
std::stringstream err;
err << "Invalid species '" << _species << "'.";
throw CreatureException(err.str());
@@ -67,7 +67,7 @@ PkmnLib::Battling::Pokemon* PkmnLib::Battling::CreatePokemon::Build() {
}
const Library::Item* heldItem = nullptr;
if (!this->_heldItem.empty()) {
if (!_library->GetItemLibrary()->TryGetItem(this->_heldItem, heldItem)) {
if (!_library->GetItemLibrary()->TryGet(this->_heldItem.c_str(), heldItem)) {
throw CreatureException("Unknown Item: " + this->_heldItem);
}
}
@@ -143,7 +143,7 @@ PkmnLib::Battling::CreatePokemon* PkmnLib::Battling::CreatePokemon::WithHeldItem
PkmnLib::Battling::CreatePokemon*
PkmnLib::Battling::CreatePokemon::LearnMove(const std::string& moveName, CreatureLib::Battling::AttackLearnMethod method) {
const PkmnLib::Library::MoveData* move;
if (!_library->GetMoveLibrary()->TryGetMove(moveName, move)){
if (!_library->GetMoveLibrary()->TryGet(moveName.c_str(), move)){
throw CreatureException("Invalid Move given: " + moveName);
}
if (_attacks.size() >= _library->GetSettings()->GetMaximalMoves()){