CommonLibSSE NG
Loading...
Searching...
No Matches
BGSStoryEventManager.h
Go to the documentation of this file.
1#pragma once
2
3#include "RE/B/BSAtomic.h"
4#include "RE/B/BSTArray.h"
5#include "RE/B/BSTHashMap.h"
6#include "RE/B/BSTSingleton.h"
7
8namespace RE
9{
10 struct BGSRegisteredStoryEvent;
11 class BGSStoryEvent;
12
14 public BSTSingletonImplicit<BGSStoryEventManager> // 00
15 {
16 public:
17 [[nodiscard]] static BGSStoryEventManager* GetSingleton()
18 {
19 using func_t = decltype(&BGSStoryEventManager::GetSingleton);
20 REL::Relocation<func_t> func{ RELOCATION_ID(22317, 22790) };
21 return func();
22 }
23
24 template <class T>
25 std::uint32_t AddEvent(const T& a_event)
26 {
27 return AddEvent_Impl(T::GetIndex(), &a_event);
28 }
29
30 // members
35
36 private:
37 std::uint32_t AddEvent_Impl(std::uint32_t a_index, const void* a_event)
38 {
39 using func_t = decltype(&BGSStoryEventManager::AddEvent_Impl);
40 REL::Relocation<func_t> func{ RELOCATION_ID(31576, 32359) };
41 return func(this, a_index, a_event);
42 }
43 };
44 static_assert(sizeof(BGSStoryEventManager) == 0x68);
45}
#define RELOCATION_ID(a_se, a_ae)
Definition PCH.h:794
Definition BGSStoryEventManager.h:15
BSSpinLock eventArrayLock
Definition BGSStoryEventManager.h:34
BSTHashMap< std::uint32_t, std::uint32_t > registeredEventIDs
Definition BGSStoryEventManager.h:32
std::uint32_t AddEvent(const T &a_event)
Definition BGSStoryEventManager.h:25
static BGSStoryEventManager * GetSingleton()
Definition BGSStoryEventManager.h:17
BSTArray< BGSStoryEvent > events
Definition BGSStoryEventManager.h:33
BSTArray< BGSRegisteredStoryEvent > registeredEvents
Definition BGSStoryEventManager.h:31
Definition BSAtomic.h:49
Definition BSTArray.h:377
Definition BSTHashMap.h:21
Definition Relocation.h:1638
Definition AbsorbEffect.h:6
Definition BSTSingleton.h:19