Added functions for battle to manipulate volatile scripts.
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
2020-02-16 17:44:41 +01:00
parent 428483e73d
commit 65f054bfab
2 changed files with 14 additions and 0 deletions

View File

@@ -75,6 +75,11 @@ namespace CreatureLib::Battling {
inline const BattleResult& GetResult() const { return _battleResult; }
const std::vector<BattleSide*>& GetSides() const { return _sides; }
Script* GetVolatileScript(const std::string& key) const { return _volatile.Get(key); }
void AddVolatileScript(const std::string& key) {
auto script = _library->LoadScript(ScriptResolver::ScriptCategory::Battle, key);
return _volatile.Add(script);
}
void RegisterEventListener(EVENT_HOOK_FUNC(listener)) { this->_eventHook.RegisterListener(listener); }
void TriggerEventListener(EventData* data) { this->_eventHook.TriggerEvent(data); }