LeviLamina
Loading...
Searching...
No Matches
TickingAreasManager.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/Subscription.h"
8#include "mc/platform/UUID.h"
9#include "mc/util/Bounds.h"
10#include "mc/world/level/dimension/DimensionType.h"
11#include "mc/world/level/ticking/AddTickingAreaStatus.h"
12#include "mc/world/level/ticking/TickingAreaLoadMode.h"
13
14// auto generated forward declare list
15// clang-format off
16class Actor;
17class BlockPos;
20class Level;
21class LevelStorage;
22class TickingAreaList;
23struct ActorUniqueID;
24struct PendingArea;
26// clang-format on
27
28class TickingAreasManager {
29public:
30 // TickingAreasManager inner types declare
31 // clang-format off
32 struct ScopedContext;
33 // clang-format on
34
35 // TickingAreasManager inner types define
36 enum class AreaLimitCheck : int {
37 None = 0,
38 ActiveStandalone = 1,
39 ActiveAndPendingStandalone = 2,
40 };
41
43 public:
44 // member variables
45 // NOLINTBEGIN
46 ::ll::TypedStorage<8, 16, ::mce::UUID> mUuid;
47 ::ll::TypedStorage<8, 32, ::std::string> mName;
48 ::ll::TypedStorage<4, 48, ::Bounds> mBounds;
49 ::ll::TypedStorage<1, 1, bool> mFinishedLoading;
50 ::ll::TypedStorage<1, 1, bool> mIsActive;
51 // NOLINTEND
52
53 public:
54 // member functions
55 // NOLINTBEGIN
56 MCAPI ~ScopedContext();
57 // NOLINTEND
58
59 public:
60 // destructor thunk
61 // NOLINTBEGIN
62 MCFOLD void $dtor();
63 // NOLINTEND
64 };
65
66 using ActivePerDimension = ::std::map<::DimensionType, ::std::shared_ptr<::TickingAreaList>>;
67
68 using PendingPerDimension = ::std::unordered_map<::DimensionType, ::std::vector<::PendingArea>>;
69
70public:
71 // member variables
72 // NOLINTBEGIN
73 ::ll::TypedStorage<8, 16, ::std::map<::DimensionType, ::std::shared_ptr<::TickingAreaList>>> mActiveAreas;
74 ::ll::TypedStorage<8, 64, ::std::unordered_map<::DimensionType, ::std::vector<::PendingArea>>> mPendingAreas;
75 ::ll::TypedStorage<1, 1, bool> mIsPreloadDone;
76 ::ll::TypedStorage<8, 24, ::Bedrock::NonOwnerPointer<::LevelStorage> const> mLevelStorage;
77 ::ll::TypedStorage<8, 16, ::Bedrock::PubSub::Subscription> mPostReloadActorAdded;
78 ::ll::TypedStorage<8, 16, ::Bedrock::PubSub::Subscription> mOnCanStartGameSaveTimerCheckSubscription;
79 // NOLINTEND
80
81public:
82 // prevent constructor by default
83 TickingAreasManager();
84
85public:
86 // member functions
87 // NOLINTBEGIN
88 MCAPI explicit TickingAreasManager(::Bedrock::NonOwnerPointer<::LevelStorage> levelStorage);
89
90 MCAPI ::AddTickingAreaStatus _addArea(
91 ::DimensionType dimensionId,
92 ::std::string const& name,
93 ::Bounds const& bounds,
94 bool isCircle,
95 ::TickingAreasManager::AreaLimitCheck limitCheck,
96 bool isPersistent,
97 ::TickingAreaLoadMode loadMode,
98 ::LevelStorage& levelStorage
99 );
100
101 MCAPI ::std::vector<::TickingAreaDescription> _getPendingAreaDescriptionsFiltered(
102 ::DimensionType dimensionId,
103 ::std::function<bool(::PendingArea const&)> includeInList
104 ) const;
105
106 MCAPI void _postReloadActorAdded(::Actor& actor);
107
108 MCAPI void addEntityArea(::DimensionType dimensionId, ::Actor const& actor, ::LevelStorage& levelStorage);
109
110 MCAPI void addEntityArea(
111 ::DimensionType dimensionId,
112 ::ActorUniqueID const& entityId,
113 ::Bounds bounds,
114 bool alwaysActive,
115 float maxDistToPlayers,
116 ::LevelStorage& levelStorage
117 );
118
119 MCAPI void addTickingAreaListForDimension(
120 ::DimensionType dimensionId,
121 ::std::shared_ptr<::TickingAreaList> const& tickingAreaList
122 );
123
124 MCAPI ::TickingAreasManager::ScopedContext addTransientScopedArea(
125 ::DimensionType dimensionId,
126 ::std::string const& name,
127 uint64 scopeKey,
128 ::mce::UUID uuid,
129 ::Bounds const& bounds
130 );
131
132 MCAPI uint countStandaloneTickingAreas() const;
133
134 MCAPI void registerForActorManagerEvents(::IActorManagerConnector& actorManagerConnector);
135
136 MCAPI void registerForLevelStorageManagerEvents(::ILevelStorageManagerConnector& levelStorageManagerConnector);
137
138 MCAPI ::std::vector<::TickingAreaDescription>
139 removePendingAreaByName(::DimensionType dimensionId, ::std::string const& name, ::LevelStorage& levelStorage);
140
141 MCAPI ::std::vector<::TickingAreaDescription>
142 removePendingAreaByPosition(::DimensionType dimensionId, ::BlockPos const& position, ::LevelStorage& levelStorage);
143
144 MCAPI void removeScopedAreas(::std::vector<::mce::UUID> const& uuids);
145
146 MCAPI ::std::vector<::TickingAreaDescription> setPendingAreaLoadModeByName(
147 ::DimensionType dimensionId,
148 ::std::string const& name,
149 ::TickingAreaLoadMode loadMode,
150 ::LevelStorage& levelStorage
151 );
152
153 MCAPI ::std::vector<::TickingAreaDescription> setPendingAreaLoadModeByPosition(
154 ::DimensionType dimensionId,
155 ::BlockPos const& position,
156 ::TickingAreaLoadMode loadMode,
157 ::LevelStorage& levelStorage
158 );
159
160 MCAPI void update(::Level& level, ::LevelStorage& levelStorage);
161 // NOLINTEND
162
163public:
164 // static functions
165 // NOLINTBEGIN
166 MCAPI static void _deletePendingArea(::LevelStorage& levelStorage, ::PendingArea const& pendingArea);
167
168 MCAPI static void
169 _savePendingArea(::LevelStorage& levelStorage, ::DimensionType dimensionId, ::PendingArea const& pendingArea);
170
171 MCAPI static ::TickingAreasManager::AreaLimitCheck getLimitCheck(::Level const& level, bool enforce);
172 // NOLINTEND
173
174public:
175 // constructor thunks
176 // NOLINTBEGIN
177 MCAPI void* $ctor(::Bedrock::NonOwnerPointer<::LevelStorage> levelStorage);
178 // NOLINTEND
179};
Definition Actor.h:113
Definition NonOwnerPointer.h:9
Definition BlockPos.h:17
Definition IActorManagerConnector.h:14
Definition ILevelStorageManagerConnector.h:13
Definition LevelStorage.h:25
Definition Level.h:254
Definition TickingAreaList.h:15
Definition UUID.h:7
Definition ActorUniqueID.h:5
Definition Bounds.h:8
Definition DimensionType.h:5
Definition PendingArea.h:18
Definition TickingAreaDescription.h:9
Definition TickingAreasManager.h:42