Disable EventHook system for now for testing.
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
2020-08-02 10:14:56 +02:00
parent d55a9e8494
commit 84e030213d
2 changed files with 43 additions and 40 deletions

View File

@@ -24,21 +24,24 @@ namespace CreatureLib::Battling {
public:
EventHook() : _offset(0), _capacity(defaultSize) {
auto ptr = calloc(defaultSize, 1);
if (ptr == nullptr) {
THROW_CREATURE("Out of memory.");
}
_memory = static_cast<uint8_t*>(ptr);
// auto ptr = calloc(defaultSize, 1);
// if (ptr == nullptr) {
// THROW_CREATURE("Out of memory.");
// }
// _memory = static_cast<uint8_t*>(ptr);
}
EventHook(const EventHook&) = delete;
EventHook& operator=(const EventHook&) = delete;
~EventHook() { free(_memory); }
~EventHook() {
// free(_memory);
}
size_t GetPosition() const noexcept { return _offset; }
size_t GetCapacity() const noexcept { return _capacity; }
template <class T, class... parameters> void Trigger(parameters... args) {
return;
if (_listeners.size() == 0)
return;
if (_offset + sizeof(T) >= _capacity) {