Store time in turn execution on battle class.
All checks were successful
continuous-integration/drone/push Build is passing
All checks were successful
continuous-integration/drone/push Build is passing
Signed-off-by: Deukhoofd <Deukhoofd@gmail.com>
This commit is contained in:
@@ -46,6 +46,7 @@ void Battle::CheckChoicesSetAndRun() {
|
||||
THROW("Exception during choices set validation: '" << e.what() << "'.")
|
||||
}
|
||||
|
||||
auto begin = std::chrono::steady_clock::now();
|
||||
auto choices = std::vector<std::shared_ptr<BaseTurnChoice>>(_numberOfSides * _creaturesPerSide);
|
||||
auto i = 0;
|
||||
try {
|
||||
@@ -90,6 +91,8 @@ void Battle::CheckChoicesSetAndRun() {
|
||||
this->_currentTurnQueue = nullptr;
|
||||
}
|
||||
TriggerEventListener<TurnEndEvent>();
|
||||
auto end = std::chrono::steady_clock::now();
|
||||
_lastTurnTime = std::chrono::duration_cast<std::chrono::microseconds>(end - begin).count();
|
||||
}
|
||||
|
||||
ArbUt::BorrowedPtr<ChoiceQueue> Battle::GetCurrentTurnQueue() const noexcept { return _currentTurnQueue; }
|
||||
|
||||
Reference in New Issue
Block a user