LeviLamina
Loading...
Searching...
No Matches
LevelListCache.h
1#pragma once
2
3#include "mc/_HeaderOutputPredefine.h"
4
5// auto generated inclusion list
6#include "mc/deps/core/file/PathBuffer.h"
7#include "mc/deps/core/minecraft/threading/EnableQueueForMainThread.h"
8#include "mc/deps/core/utility/NonOwnerPointer.h"
9#include "mc/deps/core/utility/UniqueOwnerPointer.h"
10#include "mc/platform/threading/LockGuard.h"
11#include "mc/world/level/storage/ILevelListCache.h"
12
13// auto generated forward declare list
14// clang-format off
15class AppPlatform;
16class ContentIdentity;
18class LevelCache;
19class LevelData;
20class LevelDbEnv;
23class LevelStorage;
27class Scheduler;
28struct LevelSummary;
29namespace Core { class Path; }
30// clang-format on
31
33public:
34 // member variables
35 // NOLINTBEGIN
44 // NOLINTEND
45
46public:
47 // prevent constructor by default
48 LevelListCache& operator=(LevelListCache const&);
51
52public:
53 // virtual functions
54 // NOLINTBEGIN
55 // vIndex: 0
56 virtual ~LevelListCache() /*override*/;
57
58 // vIndex: 1
59 virtual void addLevel(::std::string const& levelId, ::LevelData&& levelData) /*override*/;
60
61 // vIndex: 2
62 virtual void deleteLevel(::std::string const& levelId) /*override*/;
63
64 // vIndex: 3
65 virtual void refreshLevel(::std::string const& levelId) /*override*/;
66
67 // vIndex: 4
68 virtual void deleteLevelFiles(::std::string const& levelId) /*override*/;
69
70 // vIndex: 5
71 virtual void postDeleteLevel(::std::string const& levelId) /*override*/;
72
73 // vIndex: 6
74 virtual void renameLevel(::std::string const& levelId, ::std::string const& newLevelName) /*override*/;
75
76 // vIndex: 7
77 virtual void renameAndSaveLevelData(
78 ::std::string const& levelId,
79 ::std::string const& newLevelName,
80 ::LevelData const& levelData
81 ) /*override*/;
82
83 // vIndex: 8
84 virtual void saveLevelData(::std::string const& levelId, ::LevelData const& levelData) /*override*/;
85
86 // vIndex: 9
87 virtual void createBackupCopyOfWorld(
88 ::std::string const& levelId,
89 ::std::string const& newLevelId,
90 ::std::string const& newName
91 ) /*override*/;
92
93 // vIndex: 10
94 virtual bool hasLevelWithId(::std::string const& levelId) /*override*/;
95
96 // vIndex: 11
97 virtual bool checkIfLevelIsCorruptOrMissing(::std::string const& levelId) /*override*/;
98
99 // vIndex: 12
100 virtual void addObserver(::LevelListCacheObserver& observer) /*override*/;
101
102 // vIndex: 13
103 virtual void removeObserver(::LevelListCacheObserver& observer) /*override*/;
104
105 // vIndex: 14
106 virtual ::Bedrock::UniqueOwnerPointer<::LevelStorage> createLevelStorage(
107 ::Scheduler& scheduler,
108 ::std::string const& levelId,
109 ::ContentIdentity const& contentIdentity,
110 ::Bedrock::NotNullNonOwnerPtr<::IContentKeyProvider const> const& keyProvider,
111 ::std::chrono::nanoseconds const& writeFlushInterval,
112 ::Bedrock::NotNullNonOwnerPtr<::LevelDbEnv> levelDbEnv,
113 ::std::unique_ptr<::LevelStorageEventing> levelStorageEventing
114 ) /*override*/;
115
116 // vIndex: 15
117 virtual ::std::unique_ptr<::LevelLooseFileStorage> createLevelLooseStorage(
118 ::std::string const& levelId,
119 ::ContentIdentity const& contentIdentity,
120 ::Bedrock::NotNullNonOwnerPtr<::IContentKeyProvider const> const& keyProvider
121 ) /*override*/;
122
123 // vIndex: 16
124 virtual ::LevelSummary* getLevelSummary(::std::string const& levelId) /*override*/;
125
126 // vIndex: 17
127 virtual ::LevelSummary const* getLevelSummaryByName(::std::string const& levelName) /*override*/;
128
129 // vIndex: 18
130 virtual ::LevelSummary* getOrCreateLevelSummary(::Core::Path const& directory) /*override*/;
131
132 // vIndex: 19
133 virtual ::LevelData* getLevelData(::std::string const& levelId) /*override*/;
134
135 // vIndex: 20
136 virtual ::Bedrock::NonOwnerPointer<::LevelData> getLevelDataNonOwnerPointer(::std::string const& levelId
137 ) /*override*/;
138
139 // vIndex: 21
140 virtual ::LevelSummary* getShallowLevelSummary(::std::string const& levelId) /*override*/;
141
142 // vIndex: 22
143 virtual void getLevelList(
144 ::std::vector<::LevelSummary>& dest,
145 bool includeShallowSummaries,
146 bool includePartiallyCopiedLevels,
147 bool includeBetaRetailLevels
148 ) /*override*/;
149
150 // vIndex: 23
151 virtual bool hasCachedLevels(bool includeShallowSummaries) const /*override*/;
152
153 // vIndex: 24
154 virtual void updateLevelCache(::std::string const& levelId) /*override*/;
155
156 // vIndex: 25
157 virtual ::std::unique_ptr<::LevelStorageObserver> createLevelStorageObserver() /*override*/;
158
159 // vIndex: 26
160 virtual void onSave(::std::string const& levelId) /*override*/;
161
162 // vIndex: 27
163 virtual void onStorageChanged() /*override*/;
164
165 // vIndex: 28
166 virtual ::Core::PathBuffer<::std::string> const getBasePath() const /*override*/;
167 // NOLINTEND
168
169public:
170 // member functions
171 // NOLINTBEGIN
172 MCAPI LevelListCache(
173 ::LevelStorageSource& levelStorageSource,
174 ::Bedrock::NotNullNonOwnerPtr<::AppPlatform const> appPlatform,
175 ::std::function<bool()>&& checkIsSafeToFlushCache
176 );
177
178 MCAPI ::LevelCache* _addOrReplaceCache(::Core::Path const& path);
179
180 MCAPI ::LevelCache* _addToCache(::Core::Path const& path);
181
182 MCAPI ::LevelCache* _addToCache(::std::string const& levelId, ::LevelCache&& levelCache);
183
184 MCAPI ::LevelCache* _createAndAddToCache(::std::string const& levelId, ::Core::Path const& directory);
185
186 MCAPI ::LevelSummary* _getLevelSummary(::std::string const& levelId);
187
188 MCAPI void _notifyLevelUpdated(::std::string const& levelId);
189
190 MCAPI void _refreshSummary(::std::string const& levelId, ::LevelCache& cache);
191 // NOLINTEND
192
193public:
194 // constructor thunks
195 // NOLINTBEGIN
196 MCAPI void* $ctor(
197 ::LevelStorageSource& levelStorageSource,
198 ::Bedrock::NotNullNonOwnerPtr<::AppPlatform const> appPlatform,
199 ::std::function<bool()>&& checkIsSafeToFlushCache
200 );
201 // NOLINTEND
202
203public:
204 // destructor thunk
205 // NOLINTBEGIN
206 MCAPI void $dtor();
207 // NOLINTEND
208
209public:
210 // virtual function thunks
211 // NOLINTBEGIN
212 MCAPI void $addLevel(::std::string const& levelId, ::LevelData&& levelData);
213
214 MCAPI void $deleteLevel(::std::string const& levelId);
215
216 MCAPI void $refreshLevel(::std::string const& levelId);
217
218 MCAPI void $deleteLevelFiles(::std::string const& levelId);
219
220 MCAPI void $postDeleteLevel(::std::string const& levelId);
221
222 MCAPI void $renameLevel(::std::string const& levelId, ::std::string const& newLevelName);
223
224 MCAPI void $renameAndSaveLevelData(
225 ::std::string const& levelId,
226 ::std::string const& newLevelName,
227 ::LevelData const& levelData
228 );
229
230 MCAPI void $saveLevelData(::std::string const& levelId, ::LevelData const& levelData);
231
232 MCAPI void $createBackupCopyOfWorld(
233 ::std::string const& levelId,
234 ::std::string const& newLevelId,
235 ::std::string const& newName
236 );
237
238 MCAPI bool $hasLevelWithId(::std::string const& levelId);
239
240 MCAPI bool $checkIfLevelIsCorruptOrMissing(::std::string const& levelId);
241
242 MCAPI void $addObserver(::LevelListCacheObserver& observer);
243
244 MCAPI void $removeObserver(::LevelListCacheObserver& observer);
245
246 MCAPI ::Bedrock::UniqueOwnerPointer<::LevelStorage> $createLevelStorage(
247 ::Scheduler& scheduler,
248 ::std::string const& levelId,
249 ::ContentIdentity const& contentIdentity,
250 ::Bedrock::NotNullNonOwnerPtr<::IContentKeyProvider const> const& keyProvider,
251 ::std::chrono::nanoseconds const& writeFlushInterval,
252 ::Bedrock::NotNullNonOwnerPtr<::LevelDbEnv> levelDbEnv,
253 ::std::unique_ptr<::LevelStorageEventing> levelStorageEventing
254 );
255
256 MCAPI ::std::unique_ptr<::LevelLooseFileStorage> $createLevelLooseStorage(
257 ::std::string const& levelId,
258 ::ContentIdentity const& contentIdentity,
259 ::Bedrock::NotNullNonOwnerPtr<::IContentKeyProvider const> const& keyProvider
260 );
261
262 MCAPI ::LevelSummary* $getLevelSummary(::std::string const& levelId);
263
264 MCAPI ::LevelSummary const* $getLevelSummaryByName(::std::string const& levelName);
265
266 MCAPI ::LevelSummary* $getOrCreateLevelSummary(::Core::Path const& directory);
267
268 MCAPI ::LevelData* $getLevelData(::std::string const& levelId);
269
270 MCAPI ::Bedrock::NonOwnerPointer<::LevelData> $getLevelDataNonOwnerPointer(::std::string const& levelId);
271
272 MCAPI ::LevelSummary* $getShallowLevelSummary(::std::string const& levelId);
273
274 MCAPI void $getLevelList(
275 ::std::vector<::LevelSummary>& dest,
276 bool includeShallowSummaries,
277 bool includePartiallyCopiedLevels,
278 bool includeBetaRetailLevels
279 );
280
281 MCAPI bool $hasCachedLevels(bool includeShallowSummaries) const;
282
283 MCAPI void $updateLevelCache(::std::string const& levelId);
284
285 MCAPI ::std::unique_ptr<::LevelStorageObserver> $createLevelStorageObserver();
286
287 MCAPI void $onSave(::std::string const& levelId);
288
289 MCAPI void $onStorageChanged();
290
291 MCAPI ::Core::PathBuffer<::std::string> const $getBasePath() const;
292 // NOLINTEND
293
294public:
295 // vftables
296 // NOLINTBEGIN
297 MCAPI static void** $vftableForILevelListCache();
298
299 MCAPI static void** $vftableForEnableQueueForMainThread();
300 // NOLINTEND
301};
Definition AppPlatform.h:49
Definition EnableQueueForMainThread.h:10
Definition ContentIdentity.h:10
Definition Path.h:15
Definition IContentKeyProvider.h:13
Definition ILevelListCache.h:27
Definition LevelCache.h:5
Definition LevelData.h:48
Definition LevelDbEnv.h:8
Definition LevelListCacheObserver.h:13
Definition LevelListCache.h:32
Definition LevelLooseFileStorage.h:15
Definition LevelStorageEventing.h:15
Definition LevelStorageObserver.h:5
Definition LevelStorageSource.h:25
Definition LevelStorage.h:24
Definition Path.h:16
Definition Scheduler.h:13
Definition LevelSummary.h:27
Definition Alias.h:14