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