3#include "mc/_HeaderOutputPredefine.h"
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"
29namespace Core {
class Path; }
48 LevelListCache& operator=(LevelListCache
const&);
49 LevelListCache(LevelListCache
const&);
55 virtual ~LevelListCache() ;
57 virtual void addLevel(::std::string
const& levelId,
::LevelData&& levelData) ;
59 virtual void deleteLevel(::std::string
const& levelId) ;
61 virtual void refreshLevel(::std::string
const& levelId) ;
63 virtual void deleteLevelFiles(::std::string
const& levelId) ;
65 virtual void postDeleteLevel(::std::string
const& levelId) ;
67 virtual void renameLevel(::std::string
const& levelId, ::std::string
const& newLevelName) ;
69 virtual void renameAndSaveLevelData(
70 ::std::string
const& levelId,
71 ::std::string
const& newLevelName,
75 virtual void saveLevelData(::std::string
const& levelId,
::LevelData const& levelData) ;
77 virtual void createBackupCopyOfWorld(
78 ::std::string
const& levelId,
79 ::std::string
const& newLevelId,
80 ::std::string
const& newName
83 virtual bool hasLevelWithId(::std::string
const& levelId) ;
87 virtual bool checkIfLevelIsCorruptOrMissing(::std::string
const& levelId) ;
93 virtual ::Bedrock::UniqueOwnerPointer<::LevelStorage> createLevelStorage(
95 ::std::string
const& levelId,
97 ::Bedrock::NotNullNonOwnerPtr<::IContentKeyProvider const>
const& keyProvider,
98 ::std::chrono::nanoseconds
const& writeFlushInterval,
99 ::Bedrock::NotNullNonOwnerPtr<::LevelDbEnv> levelDbEnv,
100 ::std::unique_ptr<::LevelStorageEventing> levelStorageEventing
103 virtual ::std::unique_ptr<::LevelLooseFileStorage> createLevelLooseStorage(
104 ::std::string
const& levelId,
106 ::Bedrock::NotNullNonOwnerPtr<::IContentKeyProvider const>
const& keyProvider
109 virtual ::LevelSummary* getLevelSummary(::std::string
const& levelId) ;
111 virtual ::LevelSummary
const* getLevelSummaryByName(::std::string
const& levelName) ;
113 virtual ::LevelSummary* getOrCreateLevelSummary(
::Core::Path const& directory) ;
115 virtual ::LevelData* getLevelData(::std::string
const& levelId) ;
117 virtual ::Bedrock::NonOwnerPointer<::LevelData>
118 getLevelDataNonOwnerPointer(::std::string
const& levelId) ;
120 virtual ::LevelSummary* getShallowLevelSummary(::std::string
const& levelId) ;
122 virtual void getLevelList(
123 ::std::vector<::LevelSummary>& dest,
124 bool includeShallowSummaries,
125 bool includePartiallyCopiedLevels,
126 bool includeBetaRetailLevels,
127 bool includeInvalidLevelDataLevels
130 virtual bool hasCachedLevels(
bool includeShallowSummaries)
const ;
132 virtual void updateLevelCache(::std::string
const& levelId) ;
134 virtual ::std::unique_ptr<::LevelStorageObserver> createLevelStorageObserver() ;
136 virtual void onSave(::std::string
const& levelId) ;
138 virtual void onStorageChanged() ;
140 virtual ::Core::PathBuffer<::std::string>
const getBasePath()
const ;
148 ::Bedrock::NotNullNonOwnerPtr<::AppPlatform const> appPlatform,
149 ::std::function<
bool()>&& checkIsSafeToFlushCache
174 ::Bedrock::NotNullNonOwnerPtr<::AppPlatform const> appPlatform,
175 ::std::function<
bool()>&& checkIsSafeToFlushCache
198 MCNAPI
void $renameLevel(::std::string
const& levelId, ::std::string
const& newLevelName);
201 ::std::string
const& levelId,
202 ::std::string
const& newLevelName,
209 ::std::string
const& levelId,
210 ::std::string
const& newLevelId,
211 ::std::string
const& newName
226 ::std::string
const& levelId,
228 ::Bedrock::NotNullNonOwnerPtr<::IContentKeyProvider const>
const& keyProvider,
229 ::std::chrono::nanoseconds
const& writeFlushInterval,
230 ::Bedrock::NotNullNonOwnerPtr<::LevelDbEnv> levelDbEnv,
231 ::std::unique_ptr<::LevelStorageEventing> levelStorageEventing
235 ::std::string
const& levelId,
237 ::Bedrock::NotNullNonOwnerPtr<::IContentKeyProvider const>
const& keyProvider
253 ::std::vector<::LevelSummary>& dest,
254 bool includeShallowSummaries,
255 bool includePartiallyCopiedLevels,
256 bool includeBetaRetailLevels,
257 bool includeInvalidLevelDataLevels
266 MCNAPI
void $onSave(::std::string
const& levelId);
Definition EnableQueueForMainThread.h:17
Definition ContentIdentity.h:8
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 $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