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 void _notifyLevelUpdated(::std::string const& levelId);
163
164 MCNAPI void _notifyNewLevelFound(::std::string const& levelId);
165
166 MCNAPI void _refreshSummary(::std::string const& levelId, ::LevelCache& cache);
167 // NOLINTEND
168
169public:
170 // constructor thunks
171 // NOLINTBEGIN
172 MCNAPI void* $ctor(
173 ::LevelStorageSource& levelStorageSource,
174 ::Bedrock::NotNullNonOwnerPtr<::AppPlatform const> appPlatform,
175 ::std::function<bool()>&& checkIsSafeToFlushCache
176 );
177 // NOLINTEND
178
179public:
180 // destructor thunk
181 // NOLINTBEGIN
182 MCNAPI void $dtor();
183 // NOLINTEND
184
185public:
186 // virtual function thunks
187 // NOLINTBEGIN
188 MCNAPI void $addLevel(::std::string const& levelId, ::LevelData&& levelData);
189
190 MCNAPI void $deleteLevel(::std::string const& levelId);
191
192 MCNAPI void $refreshLevel(::std::string const& levelId);
193
194 MCNAPI void $deleteLevelFiles(::std::string const& levelId);
195
196 MCNAPI void $postDeleteLevel(::std::string const& levelId);
197
198 MCNAPI void $renameLevel(::std::string const& levelId, ::std::string const& newLevelName);
199
201 ::std::string const& levelId,
202 ::std::string const& newLevelName,
203 ::LevelData const& levelData
204 );
205
206 MCNAPI void $saveLevelData(::std::string const& levelId, ::LevelData const& levelData);
207
209 ::std::string const& levelId,
210 ::std::string const& newLevelId,
211 ::std::string const& newName
212 );
213
214 MCNAPI bool $hasLevelWithId(::std::string const& levelId);
215
216 MCNAPI ::std::string $getLevelIdFromPath(::Core::Path const& fullPath, ::Core::Path const& worldsPath);
217
218 MCNAPI bool $checkIfLevelIsCorruptOrMissing(::std::string const& levelId);
219
221
223
224 MCNAPI ::Bedrock::UniqueOwnerPointer<::LevelStorage> $createLevelStorage(
225 ::Scheduler& scheduler,
226 ::std::string const& levelId,
227 ::ContentIdentity const& contentIdentity,
228 ::Bedrock::NotNullNonOwnerPtr<::IContentKeyProvider const> const& keyProvider,
229 ::std::chrono::nanoseconds const& writeFlushInterval,
230 ::Bedrock::NotNullNonOwnerPtr<::LevelDbEnv> levelDbEnv,
231 ::std::unique_ptr<::LevelStorageEventing> levelStorageEventing
232 );
233
234 MCNAPI ::std::unique_ptr<::LevelLooseFileStorage> $createLevelLooseStorage(
235 ::std::string const& levelId,
236 ::ContentIdentity const& contentIdentity,
237 ::Bedrock::NotNullNonOwnerPtr<::IContentKeyProvider const> const& keyProvider
238 );
239
240 MCNAPI ::LevelSummary* $getLevelSummary(::std::string const& levelId);
241
242 MCNAPI ::LevelSummary const* $getLevelSummaryByName(::std::string const& levelName);
243
244 MCNAPI ::LevelSummary* $getOrCreateLevelSummary(::Core::Path const& directory);
245
246 MCNAPI ::LevelData* $getLevelData(::std::string const& levelId);
247
248 MCNAPI ::Bedrock::NonOwnerPointer<::LevelData> $getLevelDataNonOwnerPointer(::std::string const& levelId);
249
250 MCNAPI ::LevelSummary* $getShallowLevelSummary(::std::string const& levelId);
251
252 MCNAPI void $getLevelList(
253 ::std::vector<::LevelSummary>& dest,
254 bool includeShallowSummaries,
255 bool includePartiallyCopiedLevels,
256 bool includeBetaRetailLevels,
257 bool includeInvalidLevelDataLevels
258 );
259
260 MCNAPI bool $hasCachedLevels(bool includeShallowSummaries) const;
261
262 MCNAPI void $updateLevelCache(::std::string const& levelId);
263
264 MCNAPI ::std::unique_ptr<::LevelStorageObserver> $createLevelStorageObserver();
265
266 MCNAPI void $onSave(::std::string const& levelId);
267
268 MCNAPI void $onStorageChanged();
269
270 MCNAPI ::Core::PathBuffer<::std::string> const $getBasePath() const;
271
272
273 // NOLINTEND
274
275public:
276 // vftables
277 // NOLINTBEGIN
278 MCNAPI static void** $vftableForILevelListCache();
279
281 // NOLINTEND
282};
Definition AppPlatform.h:91
Definition EnableQueueForMainThread.h:17
Definition ContentIdentity.h:8
Definition Path.h:17
Definition IContentKeyProvider.h:13
Definition ILevelListCache.h:27
Definition LevelCache.h:5
Definition LevelData.h:52
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 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::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 $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:15
Definition LevelStorageEventing.h:15
Definition LevelStorageObserver.h:5
Definition LevelStorageSource.h:25
Definition LevelStorage.h:25
Definition Scheduler.h:14
Definition LevelSummary.h:30
Definition Alias.h:14