CommonLibSSE (powerof3)
Loading...
Searching...
No Matches
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
7namespace RE
8{
9 class BGSKeyword;
10
12 {
13 public:
14 inline static constexpr auto RTTI = RTTI_BGSKeywordForm;
15
16 ~BGSKeywordForm() override; // 00
17
18 // override (BaseFormComponent)
19 void InitializeDataComponent() override; // 01 - { return; }
20 void ClearDataComponent() override; // 02
21 void CopyComponent(BaseFormComponent* a_rhs) override; // 03
22
23 // add
24 virtual bool HasKeyword(const BGSKeyword* a_keyword) const; // 04
25 [[nodiscard]] virtual BGSKeyword* GetDefaultKeyword() const; // 05 - { return 0; }
26
27 bool AddKeyword(BGSKeyword* a_keyword);
28 bool AddKeywords(const std::vector<BGSKeyword*>& a_keywords);
29 [[nodiscard]] bool ContainsKeywordString(std::string_view a_editorID) const;
30 void ForEachKeyword(std::function<BSContainer::ForEachResult(BGSKeyword&)> a_callback) const;
31 [[nodiscard]] std::optional<BGSKeyword*> GetKeywordAt(std::uint32_t a_idx) const;
32 [[nodiscard]] std::optional<std::uint32_t> GetKeywordIndex(BGSKeyword* a_keyword) const;
33 [[nodiscard]] std::uint32_t GetNumKeywords() const;
34 [[nodiscard]] bool HasKeywordID(FormID a_formID) const;
35 [[nodiscard]] bool HasKeywordString(std::string_view a_editorID) const;
36 bool RemoveKeyword(std::uint32_t a_index);
37 bool RemoveKeyword(BGSKeyword* a_keyword);
38 bool RemoveKeywords(const std::vector<RE::BGSKeyword*>& a_keywords);
39
40 // members
41 BGSKeyword** keywords; // 08 - KWDA
42 std::uint32_t numKeywords; // 10 - KSIZ
43 std::uint32_t pad14; // 14
44
45 private:
46 void CopyKeywords(const std::vector<RE::BGSKeyword*>& a_copiedData);
47 };
48 static_assert(sizeof(BGSKeywordForm) == 0x18);
49}
Definition: BGSKeywordForm.h:12
std::optional< BGSKeyword * > GetKeywordAt(std::uint32_t a_idx) const
virtual BGSKeyword * GetDefaultKeyword() const
std::uint32_t numKeywords
Definition: BGSKeywordForm.h:42
bool RemoveKeywords(const std::vector< RE::BGSKeyword * > &a_keywords)
std::uint32_t pad14
Definition: BGSKeywordForm.h:43
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
void ForEachKeyword(std::function< BSContainer::ForEachResult(BGSKeyword &)> a_callback) const
BGSKeyword ** keywords
Definition: BGSKeywordForm.h:41
bool AddKeywords(const std::vector< BGSKeyword * > &a_keywords)
bool ContainsKeywordString(std::string_view a_editorID) const
virtual bool HasKeyword(const BGSKeyword *a_keyword) const
~BGSKeywordForm() override
void CopyComponent(BaseFormComponent *a_rhs) override
bool HasKeywordString(std::string_view a_editorID) const
void ClearDataComponent() override
std::uint32_t GetNumKeywords() const
bool RemoveKeyword(std::uint32_t a_index)
std::optional< std::uint32_t > GetKeywordIndex(BGSKeyword *a_keyword) const
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 REL::ID RTTI_BGSKeywordForm(static_cast< std::uint64_t >(513855))