CommonLibVR
BGSListForm.h
Go to the documentation of this file.
1 #pragma once
2 
3 #include "RE/B/BSContainer.h"
4 #include "RE/B/BSTArray.h"
5 #include "RE/F/FormTypes.h"
6 #include "RE/T/TESForm.h"
7 
8 namespace RE
9 {
10  class BGSListForm : public TESForm
11  {
12  public:
13  inline static constexpr auto RTTI = RTTI_BGSListForm;
14  inline static constexpr auto VTABLE = VTABLE_BGSListForm;
15  inline static constexpr auto FORMTYPE = FormType::FormList;
16 
17  struct ChangeFlags
18  {
19  enum ChangeFlag : std::uint32_t
20  {
21  kAddedForm = (std::uint32_t)1 << 31
22  };
23  };
24 
25  struct RecordFlags
26  {
27  enum RecordFlag : std::uint32_t
28  {
29  kDeleted = 1 << 5,
30  kIgnored = 1 << 12
31  };
32  };
33 
34  ~BGSListForm() override; // 00
35 
36  // override (TESForm)
37  void ClearData() override; // 05
38  bool Load(TESFile* a_mod) override; // 06
39  void SaveGame(BGSSaveFormBuffer* a_buf) override; // 0E
40  void LoadGame(BGSLoadFormBuffer* a_buf) override; // 0F
41  void Revert(BGSLoadFormBuffer* a_buf) override; // 12
42  void InitItemImpl() override; // 13
43 
44  void AddForm(TESForm* a_form);
45  [[nodiscard]] bool ContainsOnlyType(FormType a_formType) const;
46  void ForEachForm(std::function<BSContainer::ForEachResult(TESForm*)> a_callback) const;
47  [[nodiscard]] bool HasForm(const TESForm* a_form) const;
48  [[nodiscard]] bool HasForm(FormID a_formID) const;
49 
50  // members
51  BSTArray<TESForm*> forms; // 20 - LNAM
53  std::uint32_t scriptAddedFormCount; // 40
54  std::uint32_t pad44; // 44
55  private:
56  KEEP_FOR_RE()
57  };
58  static_assert(sizeof(BGSListForm) == 0x48);
59 }
#define KEEP_FOR_RE()
Definition: PCH.h:713
Definition: BGSListForm.h:11
BSTArray< FormID > * scriptAddedTempForms
Definition: BGSListForm.h:52
static constexpr auto FORMTYPE
Definition: BGSListForm.h:15
bool HasForm(const TESForm *a_form) const
bool ContainsOnlyType(FormType a_formType) const
~BGSListForm() override
std::uint32_t pad44
Definition: BGSListForm.h:54
std::uint32_t scriptAddedFormCount
Definition: BGSListForm.h:53
bool HasForm(FormID a_formID) const
static constexpr auto VTABLE
Definition: BGSListForm.h:14
bool Load(TESFile *a_mod) override
BSTArray< TESForm * > forms
Definition: BGSListForm.h:51
void InitItemImpl() override
void ClearData() override
static constexpr auto RTTI
Definition: BGSListForm.h:13
void ForEachForm(std::function< BSContainer::ForEachResult(TESForm *)> a_callback) const
void LoadGame(BGSLoadFormBuffer *a_buf) override
void AddForm(TESForm *a_form)
void SaveGame(BGSSaveFormBuffer *a_buf) override
void Revert(BGSLoadFormBuffer *a_buf) override
Definition: BGSLoadFormBuffer.h:11
Definition: BGSSaveFormBuffer.h:8
Definition: BSTArray.h:378
Definition: TESFile.h:17
Definition: TESForm.h:40
ForEachResult
Definition: BSContainer.h:6
Definition: AbsorbEffect.h:6
FormType
Definition: FormTypes.h:139
constexpr std::array< REL::ID, 1 > VTABLE_BGSListForm
Definition: Offsets_VTABLE.h:8642
std::uint32_t FormID
Definition: BSCoreTypes.h:5
constexpr REL::ID RTTI_BGSListForm(static_cast< std::uint64_t >(513877))
Definition: BGSListForm.h:18
ChangeFlag
Definition: BGSListForm.h:20
@ kAddedForm
Definition: BGSListForm.h:21
Definition: BGSListForm.h:26
RecordFlag
Definition: BGSListForm.h:28
@ kDeleted
Definition: BGSListForm.h:29
@ kIgnored
Definition: BGSListForm.h:30