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 void cleanupActorEntityReferencesGarbageCollect(::OwnerPtr<::EntityContext> entity);
104
105 MCAPI ::OwnerPtr<::EntityContext> deleteActorEntityFromWorldAndTakeEntity(::WeakEntityRef entityRef);
106
107 MCAPI void forceRemoveActorFromWorld(::Actor& actor);
108
109 MCAPI void onChunkDiscarded(::LevelChunk const& levelChunk, ::WeakEntityRef entityRef);
110
111 MCAPI void registerForLevelChunkEvents(::ILevelChunkEventManagerConnector& levelChunkEventManagerConnector);
112
113 MCAPI ::OwnerPtr<::EntityContext> removeActorEntityAndTakeEntity(::WeakEntityRef entityRef);
114
115 MCAPI void removeActorEntityReferencesForDeletion(::Actor& actor);
116
117 MCAPI ::OwnerPtr<::EntityContext> removeEntity(::WeakEntityRef entityRef);
118
119 MCAPI ::OwnerPtr<::EntityContext> takeEntity(::WeakEntityRef entityRef, ::LevelChunk& levelChunk);
120 // NOLINTEND
121
122public:
123 // constructor thunks
124 // NOLINTBEGIN
125 MCAPI void* $ctor(
126 ::std::unique_ptr<::IActorManagerProxy> actorManagerProxy,
127 ::Bedrock::NotNullNonOwnerPtr<::ActorGarbageCollector> actorGarbageCollector
128 );
129 // NOLINTEND
130
131public:
132 // destructor thunk
133 // NOLINTBEGIN
134 MCAPI void $dtor();
135 // NOLINTEND
136
137public:
138 // virtual function thunks
139 // NOLINTBEGIN
140 MCFOLD ::Bedrock::PubSub::Connector<void(::Actor&)>& $getRegisterEntityAddedConnector();
141
142 MCFOLD ::Bedrock::PubSub::Connector<void(::Actor&, ::ActorInitializationMethod)>&
143 $getRegisterPostReloadActorConnector();
144
145 MCAPI ::Bedrock::PubSub::Connector<void(::Actor&)>& $getRegisterOnRemoveActorEntityReferenceConnector();
146
147
148 // NOLINTEND
149
150public:
151 // vftables
152 // NOLINTBEGIN
153 MCNAPI static void** $vftable();
154 // NOLINTEND
155};
Definition ActorGarbageCollector.h:13
static MCAPI void ** $vftable()
Definition ActorRuntimeID.h:5
Definition Actor.h:105
Definition Publisher.h:8
Definition Dimension.h:85
Definition EntityContext.h:16
Definition IActorManagerConnector.h:14
Definition IActorManagerProxy.h:14
Definition IAddActorEntityProxy.h:10
Definition ILevelChunkEventManagerConnector.h:14
Definition LevelChunk.h:79
Definition OwnerPtr.h:7
Definition WeakEntityRef.h:14
Definition ActorUniqueID.h:5