CommonLibSSE (powerof3)
BGSKeywordForm.h
Go to the documentation of this file.
1 #pragma once
2 
3 #include "RE/B/BGSKeyword.h"
4 #include "RE/B/BSContainer.h"
6 
7 namespace RE
8 {
9  class BGSKeyword;
10 
12  {
13  public:
14  inline static constexpr auto RTTI = RTTI_BGSKeywordForm;
15  inline static constexpr auto VTABLE = VTABLE_BGSKeywordForm;
16 
17  ~BGSKeywordForm() override; // 00
18 
19  // override (BaseFormComponent)
20  void InitializeDataComponent() override; // 01 - { return; }
21  void ClearDataComponent() override; // 02
22  void CopyComponent(BaseFormComponent* a_rhs) override; // 03
23 
24  // add
25  virtual bool HasKeyword(const BGSKeyword* a_keyword) const; // 04
26  [[nodiscard]] virtual BGSKeyword* GetDefaultKeyword() const; // 05 - { return 0; }
27 
28  bool AddKeyword(BGSKeyword* a_keyword);
29  bool AddKeywords(const std::vector<BGSKeyword*>& a_keywords);
30  [[nodiscard]] bool ContainsKeywordString(std::string_view a_editorID) const;
31  void ForEachKeyword(std::function<BSContainer::ForEachResult(BGSKeyword*)> a_callback) const;
32  [[nodiscard]] std::optional<BGSKeyword*> GetKeywordAt(std::uint32_t a_idx) const;
33  [[nodiscard]] std::optional<std::uint32_t> GetKeywordIndex(BGSKeyword* a_keyword) const;
34  [[nodiscard]] std::uint32_t GetNumKeywords() const;
35  [[nodiscard]] bool HasKeywordID(FormID a_formID) const;
36  [[nodiscard]] bool HasKeywordString(std::string_view a_editorID) const;
37  bool RemoveKeyword(std::uint32_t a_index);
38  bool RemoveKeyword(BGSKeyword* a_keyword);
39  bool RemoveKeywords(const std::vector<BGSKeyword*>& a_keywords);
40 
41  // members
42  BGSKeyword** keywords; // 08 - KWDA
43  std::uint32_t numKeywords; // 10 - KSIZ
44  std::uint32_t pad14; // 14
45 
46  private:
47  void CopyKeywords(const std::vector<RE::BGSKeyword*>& a_copiedData);
48  };
49  static_assert(sizeof(BGSKeywordForm) == 0x18);
50 }
Definition: BGSKeywordForm.h:12
std::optional< std::uint32_t > GetKeywordIndex(BGSKeyword *a_keyword) const
std::uint32_t numKeywords
Definition: BGSKeywordForm.h:43
std::optional< BGSKeyword * > GetKeywordAt(std::uint32_t a_idx) const
static constexpr auto VTABLE
Definition: BGSKeywordForm.h:15
std::uint32_t pad14
Definition: BGSKeywordForm.h:44
bool HasKeywordID(FormID a_formID) const
bool RemoveKeyword(BGSKeyword *a_keyword)
static constexpr auto RTTI
Definition: BGSKeywordForm.h:14
bool AddKeyword(BGSKeyword *a_keyword)
void InitializeDataComponent() override
BGSKeyword ** keywords
Definition: BGSKeywordForm.h:42
bool AddKeywords(const std::vector< BGSKeyword * > &a_keywords)
bool ContainsKeywordString(std::string_view a_editorID) const
virtual bool HasKeyword(const BGSKeyword *a_keyword) const
virtual BGSKeyword * GetDefaultKeyword() const
bool RemoveKeywords(const std::vector< BGSKeyword * > &a_keywords)
~BGSKeywordForm() override
void CopyComponent(BaseFormComponent *a_rhs) override
void ForEachKeyword(std::function< BSContainer::ForEachResult(BGSKeyword *)> a_callback) const
bool HasKeywordString(std::string_view a_editorID) const
void ClearDataComponent() override
std::uint32_t GetNumKeywords() const
bool RemoveKeyword(std::uint32_t a_index)
Definition: BGSKeyword.h:10
Definition: BaseFormComponent.h:8
ForEachResult
Definition: BSContainer.h:6
Definition: AbsorbEffect.h:6
std::uint32_t FormID
Definition: BSCoreTypes.h:5
constexpr std::array< REL::ID, 1 > VTABLE_BGSKeywordForm
Definition: Offsets_VTABLE.h:8637
constexpr REL::ID RTTI_BGSKeywordForm(static_cast< std::uint64_t >(513855))