Reworked event hook to a system with pre-allocated memory, owned by the battle. This deals with cleaning up event data memory.
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
2020-07-31 16:19:39 +02:00
parent 3e8f9340f3
commit 0eaae43444
5 changed files with 33 additions and 13 deletions

View File

@@ -163,4 +163,4 @@ void Battle::AddVolatileScript(const ArbUt::StringView& key) {
}
void Battle::AddVolatileScript(Script* script) { return _volatile.Add(script); }
void Battle::RemoveVolatileScript(Script* script) { _volatile.Remove(script->GetName()); }
void Battle::DisplayText(const ArbUt::StringView& text) const { TriggerEventListener(new DisplayTextEvent(text)); }
void Battle::DisplayText(const ArbUt::StringView& text) { TriggerEventListener<DisplayTextEvent>(text); }