CommonLibSSE (powerof3)
TESSoulGem.h
Go to the documentation of this file.
1 #pragma once
2 
3 #include "RE/F/FormTypes.h"
4 #include "RE/S/SoulLevels.h"
5 #include "RE/T/TESObjectMISC.h"
6 
7 namespace RE
8 {
9  class TESSoulGem : public TESObjectMISC
10  {
11  public:
12  inline static constexpr auto RTTI = RTTI_TESSoulGem;
13  inline static constexpr auto VTABLE = VTABLE_TESSoulGem;
14  inline static constexpr auto FORMTYPE = FormType::SoulGem;
15 
16  struct RecordFlags
17  {
18  enum RecordFlag : std::uint32_t
19  {
20  kDeleted = 1 << 5,
21  kIgnored = 1 << 12,
22  kCanHoldNPCSoul = 1 << 17
23  };
24  };
25 
26  ~TESSoulGem() override; // 00
27 
28  // override (TESObjectMISC)
29  void InitializeData() override; // 04
30  void LoadImpl(TESFile* a_mod, std::uint32_t a_chunkID) override; // 54
31  void InitImpl() override; // 55
32 
33  // override (BGSKeywordForm)
34  [[nodiscard]] BGSKeyword* GetDefaultKeyword() const override; // 05
35 
36  [[nodiscard]] bool CanHoldNPCSoul() const noexcept { return (GetFormFlags() & RecordFlags::kCanHoldNPCSoul) != 0; }
37  [[nodiscard]] constexpr SOUL_LEVEL GetContainedSoul() const noexcept { return *currentSoul; }
38  [[nodiscard]] constexpr SOUL_LEVEL GetMaximumCapacity() const noexcept { return *soulCapacity; }
39 
40  // members
41  TESSoulGem* linkedSoulGem; // 100 - NAM0
44  std::uint16_t unk10A; // 10A
45  std::uint32_t unk10C; // 10C
46  };
47  static_assert(sizeof(TESSoulGem) == 0x110);
48 }
Definition: BGSKeyword.h:10
Definition: TESFile.h:17
std::uint32_t GetFormFlags() const noexcept
Definition: TESForm.h:288
Definition: TESObjectMISC.h:28
Definition: TESSoulGem.h:10
void InitImpl() override
REX::EnumSet< SOUL_LEVEL, std::uint8_t > currentSoul
Definition: TESSoulGem.h:42
static constexpr auto VTABLE
Definition: TESSoulGem.h:13
bool CanHoldNPCSoul() const noexcept
Definition: TESSoulGem.h:36
static constexpr auto RTTI
Definition: TESSoulGem.h:12
REX::EnumSet< SOUL_LEVEL, std::uint8_t > soulCapacity
Definition: TESSoulGem.h:43
void LoadImpl(TESFile *a_mod, std::uint32_t a_chunkID) override
TESSoulGem * linkedSoulGem
Definition: TESSoulGem.h:41
void InitializeData() override
std::uint16_t unk10A
Definition: TESSoulGem.h:44
~TESSoulGem() override
BGSKeyword * GetDefaultKeyword() const override
constexpr SOUL_LEVEL GetMaximumCapacity() const noexcept
Definition: TESSoulGem.h:38
static constexpr auto FORMTYPE
Definition: TESSoulGem.h:14
std::uint32_t unk10C
Definition: TESSoulGem.h:45
constexpr SOUL_LEVEL GetContainedSoul() const noexcept
Definition: TESSoulGem.h:37
Definition: AbsorbEffect.h:6
SOUL_LEVEL
Definition: SoulLevels.h:6
constexpr std::array< REL::ID, 10 > VTABLE_TESSoulGem
Definition: Offsets_VTABLE.h:12901
constexpr REL::ID RTTI_TESSoulGem(static_cast< std::uint64_t >(513979))
Definition: TESSoulGem.h:17
RecordFlag
Definition: TESSoulGem.h:19
@ kCanHoldNPCSoul
Definition: TESSoulGem.h:22
@ kIgnored
Definition: TESSoulGem.h:21
@ kDeleted
Definition: TESSoulGem.h:20