#pragma once #include "RE/B/BSSpinLock.h" #include "RE/B/BSTArray.h" #include "RE/B/BSTHashMap.h" #include "RE/B/BSTSingleton.h" namespace RE { class BGSRegisteredStoryEvent; class BGSStoryEvent; class BGSStoryEventManager : public BSTSingletonImplicit { public: [[nodiscard]] static BGSStoryEventManager* GetSingleton() { static REL::Relocation singleton{ ID::BGSStoryEventManager::Singleton }; return *singleton; } std::uint32_t AddEvent(std::uint32_t a_index, const void* a_event) { using func_t = std::uint32_t (BGSStoryEventManager::*)(std::uint32_t, const void*); static REL::Relocation func{ ID::BGSStoryEventManager::AddEvent }; return func(this, a_index, a_event); } template std::uint32_t AddEvent(const T& a_event) { return AddEvent(T::EVENT_INDEX(), &a_event); } // members BSTArray registeredEventArray; // 00 BSTHashMap registeredEventIDMap; // 18 BSTArray eventArray; // 48 BSSpinLock eventArrayLock; // 60 }; static_assert(sizeof(BGSStoryEventManager) == 0x68); }