CommonLibSSE NG
TESSpellList.h
Go to the documentation of this file.
1 #pragma once
2 
4 #include "RE/M/MemoryManager.h"
5 
6 namespace RE
7 {
8  class SpellItem;
9  class TESLevSpell;
10  class TESShout;
11 
13  {
14  public:
15  inline static constexpr auto RTTI = RTTI_TESSpellList;
16 
17  struct SpellData // SPLO
18  {
20  ~SpellData() = default;
21 
22  bool AddLevSpell(TESLevSpell* a_levSpell);
23  bool AddLevSpells(const std::vector<TESLevSpell*>& a_levSpells);
24  bool AddShout(TESShout* a_shout);
25  bool AddShouts(const std::vector<TESShout*>& a_shouts);
26  bool AddSpell(SpellItem* a_spell);
27  bool AddSpells(const std::vector<SpellItem*>& a_spells);
28 
29  std::optional<std::uint32_t> GetIndex(const SpellItem* a_spell) const;
30  std::optional<std::uint32_t> GetIndex(const TESLevSpell* a_levSpell) const;
31  std::optional<std::uint32_t> GetIndex(const TESShout* a_shout) const;
32 
33  bool RemoveLevSpell(TESLevSpell* a_levSpell);
34  bool RemoveLevSpells(const std::vector<TESLevSpell*>& a_levSpells);
35  bool RemoveShout(TESShout* a_shout);
36  bool RemoveShouts(const std::vector<TESShout*>& a_shouts);
37  bool RemoveSpell(SpellItem* a_spell);
38  bool RemoveSpells(const std::vector<SpellItem*>& a_spells);
39 
41 
42  SpellItem** spells; // 00
44  TESShout** shouts; // 10
45  std::uint32_t numSpells; // 18
46  std::uint32_t numlevSpells; // 1C
47  std::uint32_t numShouts; // 20
48  std::uint32_t pad24; // 24
49 
50  private:
51  void CopySpellList(const std::vector<TESLevSpell*>& a_copiedData);
52  void CopySpellList(const std::vector<TESShout*>& a_copiedData);
53  void CopySpellList(const std::vector<SpellItem*>& a_copiedData);
54  };
55  static_assert(sizeof(SpellData) == 0x28);
56 
57  ~TESSpellList() override; // 00
58 
59  // override (BaseFormComponent)
60  void InitializeDataComponent() override; // 01 - { return; }
61  void ClearDataComponent() override; // 02
62  void CopyComponent(BaseFormComponent* a_rhs) override; // 03
63 
64  // members
65  SpellData* actorEffects; // 08 - SPLO
66  };
67  static_assert(sizeof(TESSpellList) == 0x10);
68 }
Definition: BaseFormComponent.h:8
Definition: SpellItem.h:16
Definition: TESLevSpell.h:12
Definition: TESShout.h:18
Definition: TESSpellList.h:13
SpellData * actorEffects
Definition: TESSpellList.h:65
static constexpr auto RTTI
Definition: TESSpellList.h:15
void InitializeDataComponent() override
~TESSpellList() override
void CopyComponent(BaseFormComponent *a_rhs) override
void ClearDataComponent() override
Definition: AbsorbEffect.h:6
constexpr REL::VariantID RTTI_TESSpellList(513947, 392588, 0x1edb4f8)
Definition: TESSpellList.h:18
bool RemoveShout(TESShout *a_shout)
SpellItem ** spells
Definition: TESSpellList.h:42
bool AddLevSpells(const std::vector< TESLevSpell * > &a_levSpells)
bool RemoveLevSpell(TESLevSpell *a_levSpell)
bool RemoveSpell(SpellItem *a_spell)
TESShout ** shouts
Definition: TESSpellList.h:44
std::optional< std::uint32_t > GetIndex(const SpellItem *a_spell) const
std::uint32_t numSpells
Definition: TESSpellList.h:45
bool AddSpells(const std::vector< SpellItem * > &a_spells)
std::uint32_t pad24
Definition: TESSpellList.h:48
TESLevSpell ** levSpells
Definition: TESSpellList.h:43
std::optional< std::uint32_t > GetIndex(const TESLevSpell *a_levSpell) const
bool AddSpell(SpellItem *a_spell)
bool AddLevSpell(TESLevSpell *a_levSpell)
std::uint32_t numlevSpells
Definition: TESSpellList.h:46
bool RemoveLevSpells(const std::vector< TESLevSpell * > &a_levSpells)
std::optional< std::uint32_t > GetIndex(const TESShout *a_shout) const
bool RemoveShouts(const std::vector< TESShout * > &a_shouts)
bool AddShout(TESShout *a_shout)
bool RemoveSpells(const std::vector< SpellItem * > &a_spells)
bool AddShouts(const std::vector< TESShout * > &a_shouts)
std::uint32_t numShouts
Definition: TESSpellList.h:47