Use Arbutils exception Macros, instead of own ones.
All checks were successful
continuous-integration/drone/push Build is passing

Signed-off-by: Deukhoofd <Deukhoofd@gmail.com>
This commit is contained in:
2020-08-17 12:18:01 +02:00
parent 9d5316edff
commit 98dacbccde
20 changed files with 44 additions and 60 deletions

View File

@@ -43,7 +43,7 @@ void Battle::CheckChoicesSetAndRun() {
} catch (const ArbUt::Exception& e) {
throw e;
} catch (const std::exception& e) {
THROW_CREATURE("Exception during choices set validation: '" << e.what() << "'.")
THROW("Exception during choices set validation: '" << e.what() << "'.")
}
auto choices = std::vector<std::shared_ptr<BaseTurnChoice>>(_numberOfSides * _creaturesPerSide);
@@ -69,13 +69,13 @@ void Battle::CheckChoicesSetAndRun() {
side->ResetChoices();
}
} catch (const std::exception& e) {
THROW_CREATURE("Exception during turn initialization: '" << e.what() << "'.")
THROW("Exception during turn initialization: '" << e.what() << "'.")
}
_currentTurn++;
try {
TurnOrdering::OrderChoices(choices, _random.GetRNG());
} catch (const std::exception& e) {
THROW_CREATURE("Exception during turn ordering: '" << e.what() << "'.")
THROW("Exception during turn ordering: '" << e.what() << "'.")
}
this->_currentTurnQueue = std::make_unique<ChoiceQueue>(choices);
TriggerEventListener<TurnStartEvent>();
@@ -84,7 +84,7 @@ void Battle::CheckChoicesSetAndRun() {
} catch (const ArbUt::Exception& e) {
throw e;
} catch (const std::exception& e) {
THROW_CREATURE("Error during running a turn: '" << e.what() << "'.");
THROW("Error during running a turn: '" << e.what() << "'.");
}
if (this->_currentTurnQueue->HasCompletedQueue) {
this->_currentTurnQueue = nullptr;
@@ -160,7 +160,7 @@ void Battle::AddVolatileScript(const ArbUt::StringView& key) {
}
script = _library->LoadScript(ScriptCategory::Battle, key);
if (script == nullptr) {
THROW_CREATURE("Invalid volatile script requested for battle: '" << key.c_str() << "'.");
THROW("Invalid volatile script requested for battle: '" << key.c_str() << "'.");
}
return _volatile.Add(script.GetRaw());
}