CommonLibSSE NG
Loading...
Searching...
No Matches
InventoryEntryData.h
Go to the documentation of this file.
1#pragma once
2
3#include "RE/B/BSTList.h"
5#include "RE/F/FormTypes.h"
7#include "RE/S/SoulLevels.h"
8
9namespace RE
10{
11 class ExtraDataList;
12 class TESBoundObject;
13
15 {
16 public:
17 InventoryEntryData() noexcept = default;
19
21 object(std::exchange(a_rhs.object, nullptr)),
22 extraLists(std::exchange(a_rhs.extraLists, nullptr)),
23 countDelta(std::exchange(a_rhs.countDelta, 0))
24 {}
25
26 InventoryEntryData(TESBoundObject* a_object, std::int32_t a_countDelta) :
27 object(a_object),
28 countDelta(a_countDelta)
29 {}
30
32
35
37 [[nodiscard]] const char* GetDisplayName();
38 [[nodiscard]] EnchantmentItem* GetEnchantment() const;
39 [[nodiscard]] std::optional<double> GetEnchantmentCharge() const;
40 [[nodiscard]] constexpr TESBoundObject* GetObject() noexcept { return object; }
41 [[nodiscard]] constexpr const TESBoundObject* GetObject() const noexcept { return object; }
42 [[nodiscard]] TESForm* GetOwner();
43 [[nodiscard]] SOUL_LEVEL GetSoulLevel() const;
44 [[nodiscard]] std::int32_t GetValue() const;
45 [[nodiscard]] float GetWeight() const;
46 [[nodiscard]] bool IsEnchanted() const;
47 [[nodiscard]] bool IsFavorited() const;
48 [[nodiscard]] bool IsLeveled() const;
49 [[nodiscard]] bool IsPoisoned() const;
50 [[nodiscard]] bool IsWorn() const;
51 [[nodiscard]] bool IsOwnedBy(Actor* a_testOwner, bool a_defaultTo = true);
52 [[nodiscard]] bool IsOwnedBy(Actor* a_testOwner, TESForm* a_itemOwner, bool a_defaultTo = true);
53 [[nodiscard]] bool IsQuestObject() const;
54 void PoisonObject(AlchemyItem* a_alchItem, std::uint32_t a_count);
55
57
58 // members
59 TESBoundObject* object{ nullptr }; // 00
61 std::int32_t countDelta{ 0 }; // 10
62 std::uint32_t pad14{ 0 }; // 14
63
64 private:
65 [[nodiscard]] bool IsOwnedBy_Impl(Actor* a_testOwner, TESForm* a_itemOwner, bool a_defaultTo);
66
67 template <class T>
68 [[nodiscard]] bool HasExtraDataType() const
69 {
70 if (extraLists) {
71 for (const auto& xList : *extraLists) {
72 if (xList && xList->HasType<T>()) {
73 return true;
74 }
75 }
76 }
77
78 return false;
79 }
80 };
81 static_assert(sizeof(InventoryEntryData) == 0x18);
82}
Definition Actor.h:131
Definition AlchemyItem.h:24
Definition BSTList.h:10
Definition EnchantmentItem.h:10
Definition ExtraDataList.h:53
Definition InventoryEntryData.h:15
bool IsFavorited() const
float GetWeight() const
TESBoundObject * object
Definition InventoryEntryData.h:59
bool IsLeveled() const
constexpr const TESBoundObject * GetObject() const noexcept
Definition InventoryEntryData.h:41
InventoryEntryData & operator=(const InventoryEntryData &a_rhs)
const char * GetDisplayName()
bool IsEnchanted() const
void AddExtraList(ExtraDataList *a_extra)
TESForm * GetOwner()
std::int32_t countDelta
Definition InventoryEntryData.h:61
BSSimpleList< ExtraDataList * > * extraLists
Definition InventoryEntryData.h:60
bool IsOwnedBy(Actor *a_testOwner, TESForm *a_itemOwner, bool a_defaultTo=true)
TES_HEAP_REDEFINE_NEW()
bool IsPoisoned() const
InventoryEntryData() noexcept=default
std::uint32_t pad14
Definition InventoryEntryData.h:62
bool IsOwnedBy(Actor *a_testOwner, bool a_defaultTo=true)
constexpr TESBoundObject * GetObject() noexcept
Definition InventoryEntryData.h:40
bool IsWorn() const
bool IsQuestObject() const
std::optional< double > GetEnchantmentCharge() const
InventoryEntryData & operator=(InventoryEntryData &&a_rhs)
~InventoryEntryData()
SOUL_LEVEL GetSoulLevel() const
EnchantmentItem * GetEnchantment() const
std::int32_t GetValue() const
InventoryEntryData(TESBoundObject *a_object, std::int32_t a_countDelta)
Definition InventoryEntryData.h:26
void PoisonObject(AlchemyItem *a_alchItem, std::uint32_t a_count)
Definition TESBoundObject.h:24
Definition TESForm.h:35
Definition AbsorbEffect.h:6
SOUL_LEVEL
Definition SoulLevels.h:6
Definition ActorValueList.h:28