CommonLibSSE (Parapets fork)
InventoryEntryData.h
Go to the documentation of this file.
1 #pragma once
2 
3 #include "RE/B/BSSimpleList.h"
4 #include "RE/F/FormTypes.h"
5 #include "RE/M/MemoryManager.h"
6 #include "RE/S/SoulLevels.h"
7 
8 namespace RE
9 {
10  class ExtraDataList;
11  class TESBoundObject;
12 
14  {
15  public:
16  InventoryEntryData() noexcept = default;
18 
20  object(std::exchange(a_rhs.object, nullptr)),
21  extraLists(std::exchange(a_rhs.extraLists, nullptr)),
22  countDelta(std::exchange(a_rhs.countDelta, 0))
23  {}
24 
25  InventoryEntryData(TESBoundObject* a_object, std::int32_t a_countDelta) :
26  object(a_object),
27  countDelta(a_countDelta)
28  {}
29 
31 
34 
35  void AddExtraList(ExtraDataList* a_extra);
37  [[nodiscard]] const char* GetDisplayName();
38  [[nodiscard]] std::optional<double> GetEnchantmentCharge() const;
39  [[nodiscard]] constexpr TESBoundObject* GetObject() noexcept { return object; }
40  [[nodiscard]] constexpr const TESBoundObject* GetObject() const noexcept { return object; }
41  [[nodiscard]] TESForm* GetOwner();
42  [[nodiscard]] SOUL_LEVEL GetSoulLevel() const;
43  [[nodiscard]] std::int32_t GetValue() const;
44  [[nodiscard]] float GetWeight() const;
45  [[nodiscard]] bool IsEnchanted() const;
46  [[nodiscard]] bool IsLeveled() const;
47  [[nodiscard]] bool IsWorn() const;
48 
49  [[nodiscard]] bool IsOwnedBy(Actor* a_testOwner, bool a_defaultTo = true);
50  [[nodiscard]] bool IsOwnedBy(Actor* a_testOwner, TESForm* a_itemOwner, bool a_defaultTo = true);
51  [[nodiscard]] bool IsQuestObject() const;
52  void SetWorn(bool a_worn, bool a_left, bool a_deleteExtraList = true);
53 
55 
56  // members
57  TESBoundObject* object{ nullptr }; // 00
59  std::int32_t countDelta{ 0 }; // 10
60  std::uint32_t pad14{ 0 }; // 14
61 
62  private:
63  [[nodiscard]] bool IsOwnedBy_Impl(Actor* a_testOwner, TESForm* a_itemOwner, bool a_defaultTo);
64  };
65  static_assert(sizeof(InventoryEntryData) == 0x18);
66 }
Definition: Actor.h:134
Definition: BSSimpleList.h:10
Definition: ExtraDataList.h:50
Definition: InventoryEntryData.h:14
std::optional< double > GetEnchantmentCharge() const
float GetWeight() const
TESBoundObject * object
Definition: InventoryEntryData.h:57
bool IsLeveled() const
bool IsEnchanted() const
void AddExtraList(ExtraDataList *a_extra)
std::int32_t countDelta
Definition: InventoryEntryData.h:59
BSSimpleList< ExtraDataList * > * extraLists
Definition: InventoryEntryData.h:58
bool IsOwnedBy(Actor *a_testOwner, TESForm *a_itemOwner, bool a_defaultTo=true)
constexpr const TESBoundObject * GetObject() const noexcept
Definition: InventoryEntryData.h:40
void SetWorn(bool a_worn, bool a_left, bool a_deleteExtraList=true)
InventoryEntryData() noexcept=default
std::uint32_t pad14
Definition: InventoryEntryData.h:60
bool IsOwnedBy(Actor *a_testOwner, bool a_defaultTo=true)
constexpr TESBoundObject * GetObject() noexcept
Definition: InventoryEntryData.h:39
InventoryEntryData & DeepCopy(const InventoryEntryData &a_rhs)
bool IsQuestObject() const
const char * GetDisplayName()
SOUL_LEVEL GetSoulLevel() const
InventoryEntryData & operator=(const InventoryEntryData &a_rhs)
std::int32_t GetValue() const
InventoryEntryData(TESBoundObject *a_object, std::int32_t a_countDelta)
Definition: InventoryEntryData.h:25
InventoryEntryData & operator=(InventoryEntryData &&a_rhs)
Definition: TESBoundObject.h:24
Definition: TESForm.h:34
Definition: AbsorbEffect.h:6
SOUL_LEVEL
Definition: SoulLevels.h:6
Definition: NiBinaryStream.h:94