CommonLibSSE (Parapets fork)
Loading...
Searching...
No Matches
TESContainer.h
Go to the documentation of this file.
1#pragma once
2
5
6namespace RE
7{
8 class TESBoundObject;
9
11 {
12 public:
13 // members
14 std::int32_t count; // 00 - CNTO~
15 std::uint32_t pad04; // 04
16 TESBoundObject* obj; // 08 - ~CNTO
18 };
19 static_assert(sizeof(ContainerObject) == 0x18);
20
22 {
23 public:
24 inline static constexpr auto RTTI = RTTI_TESContainer;
25
26 ~TESContainer() override; // 00
27
28 // override (BaseFormComponent)
29 void InitializeDataComponent() override; // 01 - { return; }
30 void ClearDataComponent() override; // 02
31 void CopyComponent(BaseFormComponent* a_rhs) override; // 03
32
33 inline void ForEachContainerObject(std::function<bool(ContainerObject&)> a_fn) const
34 {
35 for (std::uint32_t i = 0; i < numContainerObjects; ++i) {
36 auto entry = containerObjects[i];
37 if (entry) {
38 if (!a_fn(*entry)) {
39 break;
40 }
41 }
42 }
43 }
44
45 [[nodiscard]] std::optional<ContainerObject*> GetContainerObjectAt(std::uint32_t a_idx) const;
46 std::int32_t CountObjectsInContainer(TESBoundObject* a_object) const;
47
48 // members
50 std::uint32_t numContainerObjects; // 10
51 std::uint32_t pad14; // 14
52 };
53 static_assert(sizeof(TESContainer) == 0x18);
54}
Definition: BaseFormComponent.h:8
Definition: TESBoundObject.h:24
Definition: TESContainer.h:22
static constexpr auto RTTI
Definition: TESContainer.h:24
void ClearDataComponent() override
void CopyComponent(BaseFormComponent *a_rhs) override
std::optional< ContainerObject * > GetContainerObjectAt(std::uint32_t a_idx) const
std::uint32_t numContainerObjects
Definition: TESContainer.h:50
std::int32_t CountObjectsInContainer(TESBoundObject *a_object) const
~TESContainer() override
ContainerObject ** containerObjects
Definition: TESContainer.h:49
std::uint32_t pad14
Definition: TESContainer.h:51
void ForEachContainerObject(std::function< bool(ContainerObject &)> a_fn) const
Definition: TESContainer.h:33
void InitializeDataComponent() override
Definition: AbsorbEffect.h:6
constexpr REL::ID RTTI_TESContainer
Definition: Offsets_RTTI.h:5983
Definition: ContainerItemExtra.h:9
Definition: TESContainer.h:11
std::int32_t count
Definition: TESContainer.h:14
ContainerItemExtra * itemExtra
Definition: TESContainer.h:17
std::uint32_t pad04
Definition: TESContainer.h:15
TESBoundObject * obj
Definition: TESContainer.h:16