Adds support for History data, allowing us to store specific interesting occurrences in the data flow, and recall them later.
All checks were successful
continuous-integration/drone/push Build is passing

Signed-off-by: Deukhoofd <Deukhoofd@gmail.com>
This commit is contained in:
2020-08-14 15:18:00 +02:00
parent 939fee3f50
commit cb4765e0cc
12 changed files with 150 additions and 19 deletions

View File

@@ -7,7 +7,7 @@
#include "../../Library/Exceptions/CreatureException.hpp"
#include "Events/EventData.hpp"
template <class T> concept Event = std::is_base_of<CreatureLib::Battling::EventData, T>::value;
template <class T> concept EventDataType = std::is_base_of<CreatureLib::Battling::EventData, T>::value;
namespace CreatureLib::Battling {
/// The Event Hook class allows users to write consumers for the battle events, for example to write User Interfaces
@@ -41,7 +41,7 @@ namespace CreatureLib::Battling {
size_t GetPosition() const noexcept { return _offset; }
size_t GetCapacity() const noexcept { return _capacity; }
template <Event T, class... parameters> void Trigger(parameters... args) {
template <EventDataType T, class... parameters> void Trigger(parameters... args) {
if (_listeners.size() == 0)
return;