CommonLibSSE (powerof3)
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 
8 namespace RE
9 {
10  class 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  static 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
34  mutable BSSpinLock eventArrayLock; // 60
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  static 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(SE, AE)
Definition: PCH.h:505
Definition: Relocation.h:210
Definition: BGSStoryEventManager.h:15
static BGSStoryEventManager * GetSingleton()
Definition: BGSStoryEventManager.h:17
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
BSTArray< BGSStoryEvent > events
Definition: BGSStoryEventManager.h:33
BSTArray< BGSRegisteredStoryEvent > registeredEvents
Definition: BGSStoryEventManager.h:31
Definition: BSAtomic.h:92
Definition: BSTArray.h:378
Definition: BSTHashMap.h:21
Definition: AbsorbEffect.h:6
Definition: BSTSingleton.h:19