CommonLibSSE NG
InventoryChanges.h
Go to the documentation of this file.
1 #pragma once
2 
3 #include "RE/B/BSContainer.h"
4 #include "RE/B/BSTList.h"
5 #include "RE/F/FormTypes.h"
6 #include "RE/M/MemoryManager.h"
7 #include "RE/T/TESBoundObject.h"
8 
9 namespace RE
10 {
11  class ExtraDataList;
12  class InventoryEntryData;
13  class TESBoundObject;
14 
16  {
17  public:
19  {
20  public:
21  inline static constexpr auto RTTI = RTTI_InventoryChanges__IItemChangeVisitor;
22  inline static constexpr auto VTABLE = VTABLE_InventoryChanges__IItemChangeVisitor;
23 
24  virtual ~IItemChangeVisitor(); // 00
25 
26  // add
27  virtual BSContainer::ForEachResult Visit(InventoryEntryData* a_entryData) = 0; // 01
28  virtual bool ShouldVisit([[maybe_unused]] InventoryEntryData* a_entryData, [[maybe_unused]] TESBoundObject* a_object) { return true; } // 02
29  virtual BSContainer::ForEachResult Unk_03(InventoryEntryData* a_entryData, [[maybe_unused]] void* a_arg2, bool* a_arg3) // 03
30  {
31  *a_arg3 = true;
32  return Visit(a_entryData);
33  }
34  };
35  static_assert(sizeof(IItemChangeVisitor) == 0x8);
36 
38  explicit InventoryChanges(TESObjectREFR* a_ref);
40 
42  TESObjectARMO* GetArmorInSlot(std::int32_t a_slot);
44  std::uint16_t GetNextUniqueID();
45  std::uint32_t GetWornMask();
48  void InitOutfitItems(BGSOutfit* a_outfit, std::uint16_t a_npcLevel);
49  void InitScripts();
50  void RemoveFavorite(InventoryEntryData* a_entry, ExtraDataList* a_itemList);
51  void RemoveAllItems(TESObjectREFR* a_ref, TESObjectREFR* a_moveToRef, bool a_arg4, bool a_keepOwnership, bool a_arg6);
52  void SendContainerChangedEvent(ExtraDataList* a_itemExtraList, TESObjectREFR* a_fromRefr, TESForm* a_item, std::int32_t a_count);
53  void SetFavorite(InventoryEntryData* a_entry, ExtraDataList* a_itemList);
54  void SetUniqueID(ExtraDataList* a_itemList, TESForm* a_oldForm, TESForm* a_newForm);
56  std::int16_t GetItemCount(RE::TESBoundObject* a_obj);
59 
61 
62  // members
64  TESObjectREFR* owner{ nullptr }; // 08
65  float totalWeight{ 0.0F }; // 10
66  float armorWeight{ 0.0F }; // 14
67  bool changed{ false }; // 18
68  std::uint8_t unk19{ 0 }; // 19
69  std::uint8_t unk1A{ 0 }; // 1A
70  std::uint8_t unk1B{ 0 }; // 1B
71  std::uint32_t unk1C{ 0 }; // 1C
72 
73  private:
74  InventoryChanges* Ctor(TESObjectREFR* a_ref);
75  void Dtor();
76  };
77  static_assert(sizeof(InventoryChanges) == 0x20);
78 }
Definition: BGSOutfit.h:11
Definition: BSTList.h:10
Definition: ExtraDataList.h:53
Definition: InventoryChanges.h:19
virtual BSContainer::ForEachResult Unk_03(InventoryEntryData *a_entryData, [[maybe_unused]] void *a_arg2, bool *a_arg3)
Definition: InventoryChanges.h:29
static constexpr auto VTABLE
Definition: InventoryChanges.h:22
virtual BSContainer::ForEachResult Visit(InventoryEntryData *a_entryData)=0
static constexpr auto RTTI
Definition: InventoryChanges.h:21
virtual bool ShouldVisit([[maybe_unused]] InventoryEntryData *a_entryData, [[maybe_unused]] TESBoundObject *a_object)
Definition: InventoryChanges.h:28
Definition: InventoryChanges.h:16
void SetUniqueID(ExtraDataList *a_itemList, TESForm *a_oldForm, TESForm *a_newForm)
void AddEntryData(InventoryEntryData *a_entry)
std::int16_t GetItemCount(RE::TESBoundObject *a_obj)
std::uint16_t GetNextUniqueID()
float totalWeight
Definition: InventoryChanges.h:65
TESObjectARMO * GetArmorInSlot(std::int32_t a_slot)
void GenerateLeveledListChanges()
std::uint8_t unk19
Definition: InventoryChanges.h:68
void VisitInventory(IItemChangeVisitor &visitor)
std::uint32_t GetWornMask()
std::uint32_t unk1C
Definition: InventoryChanges.h:71
float armorWeight
Definition: InventoryChanges.h:66
void RemoveFavorite(InventoryEntryData *a_entry, ExtraDataList *a_itemList)
TESObjectREFR * owner
Definition: InventoryChanges.h:64
bool changed
Definition: InventoryChanges.h:67
std::uint8_t unk1B
Definition: InventoryChanges.h:70
void SendContainerChangedEvent(ExtraDataList *a_itemExtraList, TESObjectREFR *a_fromRefr, TESForm *a_item, std::int32_t a_count)
BSSimpleList< InventoryEntryData * > * entryList
Definition: InventoryChanges.h:63
void RemoveAllItems(TESObjectREFR *a_ref, TESObjectREFR *a_moveToRef, bool a_arg4, bool a_keepOwnership, bool a_arg6)
std::uint8_t unk1A
Definition: InventoryChanges.h:69
void SetFavorite(InventoryEntryData *a_entry, ExtraDataList *a_itemList)
void InitOutfitItems(BGSOutfit *a_outfit, std::uint16_t a_npcLevel)
void VisitWornItems(IItemChangeVisitor &visitor)
InventoryChanges(TESObjectREFR *a_ref)
Definition: InventoryEntryData.h:15
Definition: TESBoundObject.h:24
Definition: TESForm.h:36
Definition: TESObjectARMO.h:37
Definition: TESObjectREFR.h:113
ForEachResult
Definition: BSContainer.h:6
Definition: AbsorbEffect.h:6
constexpr std::array< REL::VariantID, 1 > VTABLE_InventoryChanges__IItemChangeVisitor
Definition: Offsets_VTABLE.h:398
constexpr REL::VariantID RTTI_InventoryChanges__IItemChangeVisitor(684949, 392686, 0x1edcb48)