Make battle class fields all smart pointers.
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
2020-05-31 19:01:45 +02:00
parent 29cb4eac37
commit 01f6e59cb6
5 changed files with 16 additions and 24 deletions

View File

@@ -62,15 +62,14 @@ void Battle::CheckChoicesSetAndRun() {
}
_currentTurn++;
TurnOrdering::OrderChoices(choices, _random.GetRNG());
this->_currentTurnQueue = new ChoiceQueue(choices);
this->_currentTurnQueue.reset(new ChoiceQueue(choices));
TurnHandler::RunTurn(this->_currentTurnQueue);
if (this->_currentTurnQueue->HasCompletedQueue) {
delete this->_currentTurnQueue;
this->_currentTurnQueue = nullptr;
}
}
ChoiceQueue* Battle::GetCurrentTurnQueue() const noexcept { return _currentTurnQueue; }
ArbUt::BorrowedPtr<ChoiceQueue> Battle::GetCurrentTurnQueue() const noexcept { return _currentTurnQueue; }
BattleRandom* Battle::GetRandom() noexcept { return &_random; }