LeviLamina
Loading...
Searching...
No Matches
ActorManager.h
1#pragma once
2
3#include "mc/_HeaderOutputPredefine.h"
4
5// auto generated inclusion list
6#include "mc/deps/core/utility/NonOwnerPointer.h"
7#include "mc/deps/core/utility/pub_sub/Connector.h"
8#include "mc/deps/core/utility/pub_sub/Publisher.h"
9#include "mc/deps/core/utility/pub_sub/Subscription.h"
10#include "mc/deps/game_refs/OwnerPtr.h"
11#include "mc/platform/Result.h"
12#include "mc/world/actor/ActorInitializationMethod.h"
13#include "mc/world/level/ActorValidationError.h"
14#include "mc/world/level/IActorManagerConnector.h"
15
16// auto generated forward declare list
17// clang-format off
18class Actor;
20class ActorRuntimeID;
21class Dimension;
22class EntityContext;
26class LevelChunk;
27class WeakEntityRef;
28struct ActorUniqueID;
29namespace Bedrock::PubSub::ThreadModel { struct MultiThreaded; }
30// clang-format on
31
32class ActorManager : public ::IActorManagerConnector {
33public:
34 // member variables
35 // NOLINTBEGIN
36 ::ll::TypedStorage<8, 24, ::std::vector<::OwnerPtr<::EntityContext>>> mEntities;
37 ::ll::TypedStorage<8, 8, ::gsl::not_null<::std::unique_ptr<::IActorManagerProxy>>> mActorManagerProxy;
38 ::ll::TypedStorage<8, 24, ::Bedrock::NotNullNonOwnerPtr<::ActorGarbageCollector>> mActorGarbageCollector;
39 ::ll::TypedStorage<
40 8,
41 128,
43 mOnActorEntityAdded;
44 ::ll::TypedStorage<
45 8,
46 128,
47 ::Bedrock::PubSub::
48 Publisher<void(::Actor&, ::ActorInitializationMethod), ::Bedrock::PubSub::ThreadModel::MultiThreaded, 0>>
49 mPostReloadActor;
50 ::ll::TypedStorage<
51 8,
52 128,
54 mOnRemoveActorEntityReferences;
55 ::ll::TypedStorage<1, 1, bool> mIsLevelTearingDown;
56 ::ll::TypedStorage<8, 16, ::Bedrock::PubSub::Subscription> mOnChunkDiscarded;
57 // NOLINTEND
58
59public:
60 // prevent constructor by default
61 ActorManager();
62
63public:
64 // virtual functions
65 // NOLINTBEGIN
66 virtual ~ActorManager();
67
68 virtual ::Bedrock::PubSub::Connector<void(::Actor&)>& getRegisterEntityAddedConnector() /*override*/;
69
70 virtual ::Bedrock::PubSub::Connector<void(::Actor&, ::ActorInitializationMethod)>&
71 getRegisterPostReloadActorConnector() /*override*/;
72
73 virtual ::Bedrock::PubSub::Connector<void(::Actor&)>&
74 getRegisterOnRemoveActorEntityReferenceConnector() /*override*/;
75 // NOLINTEND
76
77public:
78 // member functions
79 // NOLINTBEGIN
80 MCAPI ActorManager(
81 ::std::unique_ptr<::IActorManagerProxy> actorManagerProxy,
82 ::Bedrock::NotNullNonOwnerPtr<::ActorGarbageCollector> actorGarbageCollector
83 );
84
85 MCAPI void _onChunkDiscarded(::LevelChunk& levelChunk);
86
87 MCAPI ::Bedrock::Result<::Actor*, ::ActorValidationError>
88 addActorEntity(::IAddActorEntityProxy& addActorEntityProxy, ::OwnerPtr<::EntityContext> entity);
89
90 MCAPI ::Bedrock::Result<::Actor*, ::ActorValidationError>
91 addActorEntity(::Dimension& dimension, ::OwnerPtr<::EntityContext> entity);
92
93 MCAPI ::Bedrock::Result<::Actor*, ::ActorValidationError> addActorEntity(
94 ::Dimension& dimension,
95 ::ActorUniqueID actorUniqueID,
96 ::ActorRuntimeID actorRuntimeID,
98 );
99
100 MCAPI ::Bedrock::Result<::Actor*, ::ActorValidationError>
101 addGlobalActorEntity(::IAddActorEntityProxy& addActorEntityProxy, ::OwnerPtr<::EntityContext> entity);
102
103 MCAPI ::Bedrock::Result<::Actor*, ::ActorValidationError>
104 addGlobalActorEntity(::Dimension& dimension, ::OwnerPtr<::EntityContext> entity);
105
106 MCAPI void cleanupActorEntityReferencesGarbageCollect(::OwnerPtr<::EntityContext> entity);
107
108 MCAPI void cleanupRemovedActorEntityReferencesGarbageCollect(::OwnerPtr<::EntityContext> entity);
109
110 MCAPI ::OwnerPtr<::EntityContext> deleteActorEntityFromWorldAndTakeEntity(::WeakEntityRef entityRef);
111
112 MCAPI void forceRemoveActor(::Actor& actor);
113
114 MCAPI void forceRemoveActorFromWorld(::Actor& actor);
115
116 MCFOLD ::std::vector<::OwnerPtr<::EntityContext>> const& getEntities() const;
117
118 MCAPI void onChunkDiscarded(::LevelChunk const& levelChunk, ::WeakEntityRef entityRef);
119
120 MCAPI void registerForLevelChunkEvents(::ILevelChunkEventManagerConnector& levelChunkEventManagerConnector);
121
122 MCAPI ::OwnerPtr<::EntityContext> removeActorEntityAndTakeEntity(::WeakEntityRef entityRef);
123
124 MCAPI ::OwnerPtr<::EntityContext> removeEntity(::WeakEntityRef entityRef);
125
126 MCFOLD void setLevelIsTearingDown();
127
128#ifdef LL_PLAT_C
129 MCAPI void shutdown();
130#endif
131
132 MCAPI ::OwnerPtr<::EntityContext> takeEntity(::WeakEntityRef entityRef, ::LevelChunk& levelChunk);
133 // NOLINTEND
134
135public:
136 // constructor thunks
137 // NOLINTBEGIN
138 MCAPI void* $ctor(
139 ::std::unique_ptr<::IActorManagerProxy> actorManagerProxy,
140 ::Bedrock::NotNullNonOwnerPtr<::ActorGarbageCollector> actorGarbageCollector
141 );
142 // NOLINTEND
143
144public:
145 // destructor thunk
146 // NOLINTBEGIN
147 MCAPI void $dtor();
148 // NOLINTEND
149
150public:
151 // virtual function thunks
152 // NOLINTBEGIN
153 MCFOLD ::Bedrock::PubSub::Connector<void(::Actor&)>& $getRegisterEntityAddedConnector();
154
155 MCFOLD ::Bedrock::PubSub::Connector<void(::Actor&, ::ActorInitializationMethod)>&
156 $getRegisterPostReloadActorConnector();
157
158 MCFOLD ::Bedrock::PubSub::Connector<void(::Actor&)>& $getRegisterOnRemoveActorEntityReferenceConnector();
159
160
161 // NOLINTEND
162
163public:
164 // vftables
165 // NOLINTBEGIN
166 MCAPI static void** $vftable();
167 // NOLINTEND
168};
Definition ActorGarbageCollector.h:13
Definition ActorRuntimeID.h:5
Definition Actor.h:123
Definition Publisher.h:8
Definition Dimension.h:88
Definition EntityContext.h:17
Definition IActorManagerConnector.h:14
Definition IActorManagerProxy.h:14
Definition IAddActorEntityProxy.h:10
Definition ILevelChunkEventManagerConnector.h:14
Definition LevelChunk.h:87
Definition OwnerPtr.h:7
Definition WeakEntityRef.h:14
Definition ActorUniqueID.h:10