Initial support for Event Hooks.
Some checks failed
continuous-integration/drone/push Build is failing
Some checks failed
continuous-integration/drone/push Build is failing
This commit is contained in:
@@ -2,6 +2,7 @@
|
||||
#define CREATURELIB_BATTLE_HPP
|
||||
|
||||
#include <vector>
|
||||
#include "../EventHooks/EventHook.hpp"
|
||||
#include "../Flow/ChoiceQueue.hpp"
|
||||
#include "../Library/BattleLibrary.hpp"
|
||||
#include "../TurnChoices/BaseTurnChoice.hpp"
|
||||
@@ -22,6 +23,7 @@ namespace CreatureLib::Battling {
|
||||
ChoiceQueue* _currentTurnQueue = nullptr;
|
||||
bool _hasEnded = false;
|
||||
BattleResult _battleResult = BattleResult::Empty();
|
||||
EventHook* _eventHook = new EventHook();
|
||||
|
||||
ScriptSet _volatile;
|
||||
|
||||
@@ -71,6 +73,9 @@ namespace CreatureLib::Battling {
|
||||
inline const BattleResult& GetResult() const { return _battleResult; }
|
||||
|
||||
const std::vector<BattleSide*>& GetSides() const { return _sides; }
|
||||
|
||||
void RegisterEventListener(EVENT_HOOK_FUNC(listener)) { this->_eventHook->RegisterListener(listener); }
|
||||
void TriggerEventListener(EventData* data) { this->_eventHook->TriggerEvent(data); }
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user