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&);
49 LevelListCache(LevelListCache const&);
50 LevelListCache();
51
52public:
53 // virtual functions
54 // NOLINTBEGIN
55 virtual ~LevelListCache() /*override*/;
56
57 virtual void addLevel(::std::string const& levelId, ::LevelData&& levelData) /*override*/;
58
59 virtual void deleteLevel(::std::string const& levelId) /*override*/;
60
61 virtual void refreshLevel(::std::string const& levelId) /*override*/;
62
63 virtual void deleteLevelFiles(::std::string const& levelId) /*override*/;
64
65 virtual void postDeleteLevel(::std::string const& levelId) /*override*/;
66
67 virtual void renameLevel(::std::string const& levelId, ::std::string const& newLevelName) /*override*/;
68
69 virtual void renameAndSaveLevelData(
70 ::std::string const& levelId,
71 ::std::string const& newLevelName,
72 ::LevelData const& levelData
73 ) /*override*/;
74
75 virtual void saveLevelData(::std::string const& levelId, ::LevelData const& levelData) /*override*/;
76
77 virtual void createBackupCopyOfWorld(
78 ::std::string const& levelId,
79 ::std::string const& newLevelId,
80 ::std::string const& newName
81 ) /*override*/;
82
83 virtual bool hasLevelWithId(::std::string const& levelId) /*override*/;
84
85 virtual ::std::string getLevelIdFromPath(::Core::Path const& fullPath, ::Core::Path const& worldsPath) /*override*/;
86
87 virtual bool checkIfLevelIsCorruptOrMissing(::std::string const& levelId) /*override*/;
88
89 virtual void addObserver(::LevelListCacheObserver& observer) /*override*/;
90
91 virtual void removeObserver(::LevelListCacheObserver& observer) /*override*/;
92
93 virtual ::Bedrock::UniqueOwnerPointer<::LevelStorage> createLevelStorage(
94 ::Scheduler& scheduler,
95 ::std::string const& levelId,
96 ::ContentIdentity const& contentIdentity,
97 ::Bedrock::NotNullNonOwnerPtr<::IContentKeyProvider const> const& keyProvider,
98 ::std::chrono::nanoseconds const& writeFlushInterval,
99 ::Bedrock::NotNullNonOwnerPtr<::LevelDbEnv> levelDbEnv,
100 ::std::unique_ptr<::LevelStorageEventing> levelStorageEventing
101 ) /*override*/;
102
103 virtual ::std::unique_ptr<::LevelLooseFileStorage> createLevelLooseStorage(
104 ::std::string const& levelId,
105 ::ContentIdentity const& contentIdentity,
106 ::Bedrock::NotNullNonOwnerPtr<::IContentKeyProvider const> const& keyProvider
107 ) /*override*/;
108
109 virtual ::LevelSummary* getLevelSummary(::std::string const& levelId) /*override*/;
110
111 virtual ::LevelSummary const* getLevelSummaryByName(::std::string const& levelName) /*override*/;
112
113 virtual ::LevelSummary* getOrCreateLevelSummary(::Core::Path const& directory) /*override*/;
114
115 virtual ::LevelData* getLevelData(::std::string const& levelId) /*override*/;
116
117 virtual ::Bedrock::NonOwnerPointer<::LevelData>
118 getLevelDataNonOwnerPointer(::std::string const& levelId) /*override*/;
119
120 virtual ::LevelSummary* getShallowLevelSummary(::std::string const& levelId) /*override*/;
121
122 virtual void getLevelList(
123 ::std::vector<::LevelSummary>& dest,
124 bool includeShallowSummaries,
125 bool includePartiallyCopiedLevels,
126 bool includeBetaRetailLevels,
127 bool includeInvalidLevelDataLevels
128 ) /*override*/;
129
130 virtual bool hasCachedLevels(bool includeShallowSummaries) const /*override*/;
131
132 virtual void updateLevelCache(::std::string const& levelId) /*override*/;
133
134 virtual ::std::unique_ptr<::LevelStorageObserver> createLevelStorageObserver() /*override*/;
135
136 virtual void onSave(::std::string const& levelId) /*override*/;
137
138 virtual void onStorageChanged() /*override*/;
139
140 virtual ::Core::PathBuffer<::std::string> const getBasePath() const /*override*/;
141 // NOLINTEND
142
143public:
144 // member functions
145 // NOLINTBEGIN
147 ::LevelStorageSource& levelStorageSource,
148 ::Bedrock::NotNullNonOwnerPtr<::AppPlatform const> appPlatform,
149 ::std::function<bool()>&& checkIsSafeToFlushCache
150 );
151
152 MCNAPI ::LevelCache* _addOrReplaceCache(::Core::Path const& path);
153
154 MCNAPI ::LevelCache* _addToCache(::Core::Path const& path);
155
156 MCNAPI ::LevelCache* _addToCache(::std::string const& levelId, ::LevelCache&& levelCache);
157
158 MCNAPI ::LevelCache* _createAndAddToCache(::std::string const& levelId, ::Core::Path const& directory);
159
160 MCNAPI ::LevelCache* _getLevelCache(::std::string const& levelId);
161
162 MCNAPI ::LevelSummary* _getLevelSummary(::std::string const& levelId);
163
164 MCNAPI void _notifyLevelDeleted(::std::string const& levelId);
165
166 MCNAPI void _notifyLevelUpdated(::std::string const& levelId);
167
168 MCNAPI void _notifyNewLevelFound(::std::string const& levelId);
169
170 MCNAPI void _notifySummaryUpdated(::std::string const& levelId);
171
172 MCNAPI void _refreshSummary(::std::string const& levelId, ::LevelCache& cache);
173 // NOLINTEND
174
175public:
176 // constructor thunks
177 // NOLINTBEGIN
178 MCNAPI void* $ctor(
179 ::LevelStorageSource& levelStorageSource,
180 ::Bedrock::NotNullNonOwnerPtr<::AppPlatform const> appPlatform,
181 ::std::function<bool()>&& checkIsSafeToFlushCache
182 );
183 // NOLINTEND
184
185public:
186 // destructor thunk
187 // NOLINTBEGIN
188 MCNAPI void $dtor();
189 // NOLINTEND
190
191public:
192 // virtual function thunks
193 // NOLINTBEGIN
194 MCNAPI void $addLevel(::std::string const& levelId, ::LevelData&& levelData);
195
196 MCNAPI void $deleteLevel(::std::string const& levelId);
197
198 MCNAPI void $refreshLevel(::std::string const& levelId);
199
200 MCNAPI void $deleteLevelFiles(::std::string const& levelId);
201
202 MCNAPI void $postDeleteLevel(::std::string const& levelId);
203
204 MCNAPI void $renameLevel(::std::string const& levelId, ::std::string const& newLevelName);
205
207 ::std::string const& levelId,
208 ::std::string const& newLevelName,
209 ::LevelData const& levelData
210 );
211
212 MCNAPI void $saveLevelData(::std::string const& levelId, ::LevelData const& levelData);
213
215 ::std::string const& levelId,
216 ::std::string const& newLevelId,
217 ::std::string const& newName
218 );
219
220 MCNAPI bool $hasLevelWithId(::std::string const& levelId);
221
222 MCNAPI ::std::string $getLevelIdFromPath(::Core::Path const& fullPath, ::Core::Path const& worldsPath);
223
224 MCNAPI bool $checkIfLevelIsCorruptOrMissing(::std::string const& levelId);
225
227
229
230 MCNAPI ::Bedrock::UniqueOwnerPointer<::LevelStorage> $createLevelStorage(
231 ::Scheduler& scheduler,
232 ::std::string const& levelId,
233 ::ContentIdentity const& contentIdentity,
234 ::Bedrock::NotNullNonOwnerPtr<::IContentKeyProvider const> const& keyProvider,
235 ::std::chrono::nanoseconds const& writeFlushInterval,
236 ::Bedrock::NotNullNonOwnerPtr<::LevelDbEnv> levelDbEnv,
237 ::std::unique_ptr<::LevelStorageEventing> levelStorageEventing
238 );
239
240 MCNAPI ::std::unique_ptr<::LevelLooseFileStorage> $createLevelLooseStorage(
241 ::std::string const& levelId,
242 ::ContentIdentity const& contentIdentity,
243 ::Bedrock::NotNullNonOwnerPtr<::IContentKeyProvider const> const& keyProvider
244 );
245
246 MCNAPI ::LevelSummary* $getLevelSummary(::std::string const& levelId);
247
248 MCNAPI ::LevelSummary const* $getLevelSummaryByName(::std::string const& levelName);
249
250 MCNAPI ::LevelSummary* $getOrCreateLevelSummary(::Core::Path const& directory);
251
252 MCNAPI ::LevelData* $getLevelData(::std::string const& levelId);
253
254 MCNAPI ::Bedrock::NonOwnerPointer<::LevelData> $getLevelDataNonOwnerPointer(::std::string const& levelId);
255
256 MCNAPI ::LevelSummary* $getShallowLevelSummary(::std::string const& levelId);
257
258 MCNAPI void $getLevelList(
259 ::std::vector<::LevelSummary>& dest,
260 bool includeShallowSummaries,
261 bool includePartiallyCopiedLevels,
262 bool includeBetaRetailLevels,
263 bool includeInvalidLevelDataLevels
264 );
265
266 MCNAPI bool $hasCachedLevels(bool includeShallowSummaries) const;
267
268 MCNAPI void $updateLevelCache(::std::string const& levelId);
269
270 MCNAPI ::std::unique_ptr<::LevelStorageObserver> $createLevelStorageObserver();
271
272 MCNAPI void $onSave(::std::string const& levelId);
273
274 MCNAPI void $onStorageChanged();
275
276 MCNAPI ::Core::PathBuffer<::std::string> const $getBasePath() const;
277
278
279 // NOLINTEND
280
281public:
282 // vftables
283 // NOLINTBEGIN
284 MCNAPI static void** $vftableForILevelListCache();
285
287 // NOLINTEND
288};
Definition AppPlatform.h:91
Definition EnableQueueForMainThread.h:11
Definition ContentIdentity.h:8
Definition Path.h:12
Definition IContentKeyProvider.h:13
Definition ILevelListCache.h:27
Definition LevelCache.h:5
Definition LevelData.h:55
Definition LevelDbEnv.h:8
Definition LevelListCacheObserver.h:13
static MCAPI void ** $vftableForEnableQueueForMainThread()
MCAPI void $deleteLevel(::std::string const &levelId)
MCAPI bool $hasLevelWithId(::std::string const &levelId)
MCAPI void $renameLevel(::std::string const &levelId, ::std::string const &newLevelName)
MCAPI::LevelCache * _getLevelCache(::std::string const &levelId)
static MCAPI void ** $vftableForILevelListCache()
MCAPI void $removeObserver(::LevelListCacheObserver &observer)
MCAPI::LevelCache * _addOrReplaceCache(::Core::Path const &path)
MCAPI::LevelSummary const * $getLevelSummaryByName(::std::string const &levelName)
MCAPI void $onSave(::std::string const &levelId)
MCAPI::LevelSummary * $getLevelSummary(::std::string const &levelId)
MCAPI void $dtor()
MCAPI::LevelSummary * _getLevelSummary(::std::string const &levelId)
MCAPI void $refreshLevel(::std::string const &levelId)
MCAPI LevelListCache(::LevelStorageSource &levelStorageSource, ::Bedrock::NotNullNonOwnerPtr<::AppPlatform const > appPlatform, ::std::function< bool()> &&checkIsSafeToFlushCache)
MCAPI ::Bedrock::NonOwnerPointer<::LevelData > $getLevelDataNonOwnerPointer(::std::string const &levelId)
MCAPI ::Core::PathBuffer<::std::string > const $getBasePath() const
MCAPI::LevelCache * _createAndAddToCache(::std::string const &levelId, ::Core::Path const &directory)
MCAPI void _notifySummaryUpdated(::std::string const &levelId)
MCAPI::std::string $getLevelIdFromPath(::Core::Path const &fullPath, ::Core::Path const &worldsPath)
MCAPI::LevelCache * _addToCache(::Core::Path const &path)
MCAPI bool $hasCachedLevels(bool includeShallowSummaries) const
MCAPI void $addLevel(::std::string const &levelId, ::LevelData &&levelData)
MCAPI::LevelCache * _addToCache(::std::string const &levelId, ::LevelCache &&levelCache)
MCAPI void $addObserver(::LevelListCacheObserver &observer)
MCAPI void $renameAndSaveLevelData(::std::string const &levelId, ::std::string const &newLevelName, ::LevelData const &levelData)
MCAPI void _notifyLevelDeleted(::std::string const &levelId)
MCAPI void $deleteLevelFiles(::std::string const &levelId)
MCAPI void $saveLevelData(::std::string const &levelId, ::LevelData const &levelData)
MCAPI bool $checkIfLevelIsCorruptOrMissing(::std::string const &levelId)
MCAPI void $createBackupCopyOfWorld(::std::string const &levelId, ::std::string const &newLevelId, ::std::string const &newName)
MCAPI ::std::unique_ptr<::LevelLooseFileStorage > $createLevelLooseStorage(::std::string const &levelId, ::ContentIdentity const &contentIdentity, ::Bedrock::NotNullNonOwnerPtr<::IContentKeyProvider const > const &keyProvider)
MCAPI::LevelSummary * $getShallowLevelSummary(::std::string const &levelId)
MCAPI void $updateLevelCache(::std::string const &levelId)
MCAPI::LevelSummary * $getOrCreateLevelSummary(::Core::Path const &directory)
MCAPI void _refreshSummary(::std::string const &levelId, ::LevelCache &cache)
MCAPI void _notifyLevelUpdated(::std::string const &levelId)
MCAPI void * $ctor(::LevelStorageSource &levelStorageSource, ::Bedrock::NotNullNonOwnerPtr<::AppPlatform const > appPlatform, ::std::function< bool()> &&checkIsSafeToFlushCache)
MCAPI void $getLevelList(::std::vector<::LevelSummary > &dest, bool includeShallowSummaries, bool includePartiallyCopiedLevels, bool includeBetaRetailLevels, bool includeInvalidLevelDataLevels)
MCAPI void $onStorageChanged()
MCAPI void $postDeleteLevel(::std::string const &levelId)
MCAPI::LevelData * $getLevelData(::std::string const &levelId)
MCAPI ::Bedrock::UniqueOwnerPointer<::LevelStorage > $createLevelStorage(::Scheduler &scheduler, ::std::string const &levelId, ::ContentIdentity const &contentIdentity, ::Bedrock::NotNullNonOwnerPtr<::IContentKeyProvider const > const &keyProvider, ::std::chrono::nanoseconds const &writeFlushInterval, ::Bedrock::NotNullNonOwnerPtr<::LevelDbEnv > levelDbEnv, ::std::unique_ptr<::LevelStorageEventing > levelStorageEventing)
MCAPI ::std::unique_ptr<::LevelStorageObserver > $createLevelStorageObserver()
MCAPI void _notifyNewLevelFound(::std::string const &levelId)
Definition LevelLooseFileStorage.h:16
Definition LevelStorageEventing.h:17
Definition LevelStorageObserver.h:5
Definition LevelStorageSource.h:25
Definition LevelStorage.h:26
Definition Scheduler.h:15
Definition LevelSummary.h:30
Definition Alias.h:14