CommonLibSSE NG
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  };
56  static_assert(sizeof(BGSListForm) == 0x48);
57 }
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:377
Definition: TESFile.h:17
Definition: TESForm.h:36
ForEachResult
Definition: BSContainer.h:6
Definition: AbsorbEffect.h:6
FormType
Definition: FormTypes.h:139
std::uint32_t FormID
Definition: BSCoreTypes.h:5
constexpr REL::VariantID RTTI_BGSListForm(513877, 392264, 0x1ed76b8)
constexpr std::array< REL::VariantID, 1 > VTABLE_BGSListForm
Definition: Offsets_VTABLE.h:730
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