Change LibrarySettings to be a pointer instead of value, to allow for overriding in implementations.
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
2020-02-01 13:30:51 +01:00
parent 7e0a1ec033
commit dba271681d
7 changed files with 10 additions and 10 deletions

View File

@@ -21,7 +21,7 @@ CreateCreature* CreateCreature::WithGender(Library::Gender gender) {
}
CreateCreature* CreateCreature::WithAttack(const std::string& attackName, AttackLearnMethod learnMethod) {
if (_attacks.size() >= _library->GetSettings().GetMaximalMoves())
if (_attacks.size() >= _library->GetSettings()->GetMaximalMoves())
throw CreatureException("You have already set the maximum amount of allowed moves.");
auto attackData = _library->GetAttackLibrary()->GetAttack(attackName);

View File

@@ -133,7 +133,7 @@ void Battling::Creature::GetActiveScripts(std::vector<ScriptWrapper>& scripts) {
}
void Battling::Creature::ClearVolatileScripts() { _volatile.Clear(); }
void Battling::Creature::AddExperience(uint32_t amount) {
auto maxLevel = _library->GetSettings().GetMaximalLevel();
auto maxLevel = _library->GetSettings()->GetMaximalLevel();
if (_level >= maxLevel) {
return;
}