CommonLibSSE (Parapets fork)
Loading...
Searching...
No Matches
InventoryEntryData.h
Go to the documentation of this file.
1#pragma once
2
3#include "RE/B/BSTList.h"
4#include "RE/F/FormTypes.h"
6#include "RE/S/SoulLevels.h"
7
8namespace 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
36 [[nodiscard]] const char* GetDisplayName();
37 [[nodiscard]] std::optional<double> GetEnchantmentCharge() const;
38 [[nodiscard]] constexpr TESBoundObject* GetObject() noexcept { return object; }
39 [[nodiscard]] constexpr const TESBoundObject* GetObject() const noexcept { return object; }
40 [[nodiscard]] TESForm* GetOwner();
41 [[nodiscard]] SOUL_LEVEL GetSoulLevel() const;
42
43 [[nodiscard]] std::int32_t GetValue() const
44 {
45 using func_t = decltype(&InventoryEntryData::GetValue);
47 return func(this);
48 }
49
50 [[nodiscard]] float GetWeight() const;
51 [[nodiscard]] bool IsEnchanted() const;
52 [[nodiscard]] bool IsLeveled() const;
53 [[nodiscard]] bool IsWorn() const;
54
55 [[nodiscard]] bool IsOwnedBy(Actor* a_testOwner, bool a_defaultTo = true)
56 {
57 return IsOwnedBy(a_testOwner, GetOwner(), a_defaultTo);
58 }
59
60 [[nodiscard]] bool IsOwnedBy(Actor* a_testOwner, TESForm* a_itemOwner, bool a_defaultTo = true)
61 {
62 return IsOwnedBy_Impl(a_testOwner, a_itemOwner, a_defaultTo);
63 }
64
65 [[nodiscard]] bool IsQuestObject() const
66 {
67 using func_t = decltype(&InventoryEntryData::IsQuestObject);
69 return func(this);
70 }
71
73
74 // members
75 TESBoundObject* object{ nullptr }; // 00
77 std::int32_t countDelta{ 0 }; // 10
78 std::uint32_t pad14{ 0 }; // 14
79
80 private:
81 [[nodiscard]] bool IsOwnedBy_Impl(Actor* a_testOwner, TESForm* a_itemOwner, bool a_defaultTo)
82 {
83 using func_t = decltype(&InventoryEntryData::IsOwnedBy_Impl);
85 return func(this, a_testOwner, a_itemOwner, a_defaultTo);
86 }
87 };
88 static_assert(sizeof(InventoryEntryData) == 0x18);
89}
Definition: Actor.h:125
Definition: BSTList.h:10
Definition: ExtraDataList.h:46
Definition: InventoryEntryData.h:14
float GetWeight() const
TESBoundObject * object
Definition: InventoryEntryData.h:75
bool IsLeveled() const
constexpr const TESBoundObject * GetObject() const noexcept
Definition: InventoryEntryData.h:39
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:77
BSSimpleList< ExtraDataList * > * extraLists
Definition: InventoryEntryData.h:76
bool IsOwnedBy(Actor *a_testOwner, TESForm *a_itemOwner, bool a_defaultTo=true)
Definition: InventoryEntryData.h:60
TES_HEAP_REDEFINE_NEW()
InventoryEntryData() noexcept=default
std::uint32_t pad14
Definition: InventoryEntryData.h:78
bool IsOwnedBy(Actor *a_testOwner, bool a_defaultTo=true)
Definition: InventoryEntryData.h:55
constexpr TESBoundObject * GetObject() noexcept
Definition: InventoryEntryData.h:38
bool IsWorn() const
bool IsQuestObject() const
Definition: InventoryEntryData.h:65
std::optional< double > GetEnchantmentCharge() const
InventoryEntryData & operator=(InventoryEntryData &&a_rhs)
~InventoryEntryData()
SOUL_LEVEL GetSoulLevel() const
std::int32_t GetValue() const
Definition: InventoryEntryData.h:43
InventoryEntryData(TESBoundObject *a_object, std::int32_t a_countDelta)
Definition: InventoryEntryData.h:25
Definition: TESBoundObject.h:24
Definition: TESForm.h:34
Definition: Relocation.h:858
constexpr REL::ID IsQuestObject(static_cast< std::uint64_t >(16005))
constexpr REL::ID GetValue(static_cast< std::uint64_t >(15995))
constexpr REL::ID IsOwnedBy(static_cast< std::uint64_t >(16020))
Definition: AbsorbEffect.h:6
SOUL_LEVEL
Definition: SoulLevels.h:6
Definition: NiBinaryStream.h:94