CommonLibSSE (powerof3)
BGSLocation.h
Go to the documentation of this file.
1 #pragma once
2 
3 #include "RE/B/BGSKeywordForm.h"
4 #include "RE/B/BSPointerHandle.h"
5 #include "RE/B/BSTArray.h"
6 #include "RE/B/BSTHashMap.h"
7 #include "RE/B/BSTTuple.h"
8 #include "RE/F/FormTypes.h"
9 #include "RE/N/NiSmartPointer.h"
10 #include "RE/T/TESForm.h"
11 #include "RE/T/TESFullName.h"
12 
13 namespace RE
14 {
15  class QueuedPromoteLocationReferencesTask;
16 
18  {
19  public:
20  union CellKey
21  {
23  std::uint32_t raw;
24  };
25  static_assert(sizeof(CellKey) == 0x4);
26 
27  // members
28  FormID refID; // 0
31  };
32  static_assert(sizeof(UnloadedRefData) == 0xC);
33 
34  struct SpecialRefData // LCSR
35  {
36  public:
37  // members
40  std::uint32_t pad14; // 14
41  };
42  static_assert(sizeof(SpecialRefData) == 0x18);
43 
44  struct UniqueNPCData // LCUN
45  {
46  public:
47  // members
48  Actor* actor; // 00
49  FormID refID; // 08
50  std::uint32_t pad0C; // 0C
52  };
53  static_assert(sizeof(UniqueNPCData) == 0x18);
54 
55  struct OverrideData
56  {
57  public:
58  // members
61  };
62  static_assert(sizeof(OverrideData) == 0x48);
63 
64  class BGSLocation :
65  public TESForm, // 00
66  public TESFullName, // 20
67  public BGSKeywordForm // 30
68  {
69  public:
70  inline static constexpr auto RTTI = RTTI_BGSLocation;
71  inline static constexpr auto FORMTYPE = FormType::Location;
72 
73  struct ChangeFlags
74  {
75  enum ChangeFlag : std::uint32_t
76  {
77  kKeywordData = 1 << 30,
78  kCleared = (std::uint32_t)1 << 31
79  };
80  };
81 
82  struct RecordFlags
83  {
84  enum RecordFlag : std::uint32_t
85  {
86  kDeleted = 1 << 5,
87  kIgnored = 1 << 12,
88  kCleared = (std::uint32_t)1 << 31
89  };
90  };
91 
92  struct KEYWORD_DATA
93  {
94  public:
95  // members
97  float data; // 08
98  std::uint32_t pad0C; // 0C
99  };
100  static_assert(sizeof(KEYWORD_DATA) == 0x10);
101 
102  ~BGSLocation() override; // 00
103 
104  // override (TESForm)
105  void InitializeData() override; // 04
106  bool Load(TESFile* a_mod) override; // 06
107  bool FindInFileFast(TESFile* a_mod) override; // 0C
108  void SaveGame(BGSSaveFormBuffer* a_buf) override; // 0E
109  void LoadGame(BGSLoadFormBuffer* a_buf) override; // 0F
110  void Revert(BGSLoadFormBuffer* a_buf) override; // 12
111  void InitItemImpl() override; // 13
112 
113  [[nodiscard]] bool IsCleared() const;
114  bool IsChild(const BGSLocation* a_possibleChild) const;
115  bool IsParent(const BGSLocation* a_possibleParent) const;
116  [[nodiscard]] bool IsLoaded() const;
117 
118  // members
119  BGSLocation* parentLoc; // 48 - PNAM
121  BGSMusicType* musicType; // 58 - NAM1
123  float worldLocRadius; // 64 - RNAM
125  std::uint32_t pad6C; // 6C
131  volatile std::int32_t loadedCount; // C8
132  std::uint32_t fileOffset; // CC
134  std::uint32_t lastChecked; // E8
135  bool cleared; // EC
136  bool everCleared; // ED
137  std::uint16_t padEE; // EE
138  };
139  static_assert(sizeof(BGSLocation) == 0xF0);
140 }
Definition: Actor.h:125
Definition: BGSKeywordForm.h:10
Definition: BGSKeyword.h:10
Definition: BGSLocationRefType.h:9
Definition: BGSLocation.h:68
std::uint32_t pad6C
Definition: BGSLocation.h:125
void Revert(BGSLoadFormBuffer *a_buf) override
OverrideData * overrideData
Definition: BGSLocation.h:128
float worldLocRadius
Definition: BGSLocation.h:123
bool IsParent(const BGSLocation *a_possibleParent) const
bool IsCleared() const
static constexpr auto FORMTYPE
Definition: BGSLocation.h:71
NiPointer< QueuedPromoteLocationReferencesTask > promoteRefsTask
Definition: BGSLocation.h:129
bool Load(TESFile *a_mod) override
void InitItemImpl() override
BSTArray< SpecialRefData > specialRefs
Definition: BGSLocation.h:126
ObjectRefHandle worldLocMarker
Definition: BGSLocation.h:122
static constexpr auto RTTI
Definition: BGSLocation.h:70
BSTArray< UniqueNPCData > uniqueNPCs
Definition: BGSLocation.h:127
bool everCleared
Definition: BGSLocation.h:136
bool IsLoaded() const
BGSLocation * parentLoc
Definition: BGSLocation.h:119
ObjectRefHandle horseLocMarker
Definition: BGSLocation.h:124
std::uint16_t padEE
Definition: BGSLocation.h:137
BSTArray< ObjectRefHandle > promotedRefs
Definition: BGSLocation.h:130
bool IsChild(const BGSLocation *a_possibleChild) const
BSTArray< KEYWORD_DATA > keywordData
Definition: BGSLocation.h:133
void InitializeData() override
bool cleared
Definition: BGSLocation.h:135
bool FindInFileFast(TESFile *a_mod) override
TESFaction * unreportedCrimeFaction
Definition: BGSLocation.h:120
~BGSLocation() override
volatile std::int32_t loadedCount
Definition: BGSLocation.h:131
BGSMusicType * musicType
Definition: BGSLocation.h:121
std::uint32_t lastChecked
Definition: BGSLocation.h:134
void LoadGame(BGSLoadFormBuffer *a_buf) override
std::uint32_t fileOffset
Definition: BGSLocation.h:132
void SaveGame(BGSSaveFormBuffer *a_buf) override
Definition: BGSMusicType.h:13
Definition: BSTArray.h:377
Definition: BSTHashMap.h:21
Definition: TESFaction.h:120
Definition: TESFile.h:14
Definition: TESForm.h:34
Definition: TESFullName.h:9
Definition: AbsorbEffect.h:6
constexpr REL::ID RTTI_BGSLocation
Definition: Offsets_RTTI.h:1324
std::uint32_t FormID
Definition: BSCoreTypes.h:5
Definition: BGSLocation.h:74
ChangeFlag
Definition: BGSLocation.h:76
@ kKeywordData
Definition: BGSLocation.h:77
@ kCleared
Definition: BGSLocation.h:78
Definition: BGSLocation.h:93
std::uint32_t pad0C
Definition: BGSLocation.h:98
float data
Definition: BGSLocation.h:97
BGSKeyword * keyword
Definition: BGSLocation.h:96
Definition: BGSLocation.h:83
RecordFlag
Definition: BGSLocation.h:85
@ kIgnored
Definition: BGSLocation.h:87
@ kCleared
Definition: BGSLocation.h:88
@ kDeleted
Definition: BGSLocation.h:86
Definition: BGSLocation.h:56
BSTArray< UnloadedRefData > addedData
Definition: BGSLocation.h:59
BSTSet< FormID > removedData
Definition: BGSLocation.h:60
Definition: BGSLocation.h:35
std::uint32_t pad14
Definition: BGSLocation.h:40
UnloadedRefData refData
Definition: BGSLocation.h:39
BGSLocationRefType * type
Definition: BGSLocation.h:38
Definition: BGSLocation.h:45
FormID refID
Definition: BGSLocation.h:49
Actor * actor
Definition: BGSLocation.h:48
BGSLocation * editorLoc
Definition: BGSLocation.h:51
std::uint32_t pad0C
Definition: BGSLocation.h:50
Definition: BGSLocation.h:18
CellKey cellKey
Definition: BGSLocation.h:30
FormID refID
Definition: BGSLocation.h:25
FormID parentSpaceID
Definition: BGSLocation.h:29
Definition: BGSLocation.h:21
BSTTuple< std::int16_t, std::int16_t > xy
Definition: BGSLocation.h:22
std::uint32_t raw
Definition: BGSLocation.h:23