Performance improvement for collecting scripts, by reserving size in ScriptSource.
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
2020-04-25 11:33:25 +02:00
parent 3b1c0e84e1
commit 734d056449
14 changed files with 26 additions and 0 deletions

View File

@@ -73,6 +73,8 @@ void BattleSide::GetActiveScripts(Arbutils::Collections::List<ScriptWrapper>& sc
scripts.Append(ScriptWrapper::FromSet(&_volatile));
_battle->GetActiveScripts(scripts);
}
size_t BattleSide::ScriptCount() const { return _battle->ScriptCount() + 1; }
uint8_t BattleSide::GetRandomCreatureIndex() {
// TODO: Consider adding parameter to only get index for available creatures.
AssertNotNull(_battle)