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) ;
85 virtual bool checkIfLevelIsCorruptOrMissing(::std::string
const& levelId) ;
91 virtual ::Bedrock::UniqueOwnerPointer<::LevelStorage> createLevelStorage(
93 ::std::string
const& levelId,
95 ::Bedrock::NotNullNonOwnerPtr<::IContentKeyProvider const>
const& keyProvider,
96 ::std::chrono::nanoseconds
const& writeFlushInterval,
97 ::Bedrock::NotNullNonOwnerPtr<::LevelDbEnv> levelDbEnv,
98 ::std::unique_ptr<::LevelStorageEventing> levelStorageEventing
101 virtual ::std::unique_ptr<::LevelLooseFileStorage> createLevelLooseStorage(
102 ::std::string
const& levelId,
104 ::Bedrock::NotNullNonOwnerPtr<::IContentKeyProvider const>
const& keyProvider
107 virtual ::LevelSummary* getLevelSummary(::std::string
const& levelId) ;
109 virtual ::LevelSummary
const* getLevelSummaryByName(::std::string
const& levelName) ;
111 virtual ::LevelSummary* getOrCreateLevelSummary(
::Core::Path const& directory) ;
113 virtual ::LevelData* getLevelData(::std::string
const& levelId) ;
115 virtual ::Bedrock::NonOwnerPointer<::LevelData>
116 getLevelDataNonOwnerPointer(::std::string
const& levelId) ;
118 virtual ::LevelSummary* getShallowLevelSummary(::std::string
const& levelId) ;
120 virtual void getLevelList(
121 ::std::vector<::LevelSummary>& dest,
122 bool includeShallowSummaries,
123 bool includePartiallyCopiedLevels,
124 bool includeBetaRetailLevels,
125 bool includeInvalidLevelDataLevels
128 virtual bool hasCachedLevels(
bool includeShallowSummaries)
const ;
130 virtual void updateLevelCache(::std::string
const& levelId) ;
132 virtual ::std::unique_ptr<::LevelStorageObserver> createLevelStorageObserver() ;
134 virtual void onSave(::std::string
const& levelId) ;
136 virtual void onStorageChanged() ;
138 virtual ::Core::PathBuffer<::std::string>
const getBasePath()
const ;
146 ::Bedrock::NotNullNonOwnerPtr<::AppPlatform const> appPlatform,
147 ::std::function<
bool()>&& checkIsSafeToFlushCache
172 ::Bedrock::NotNullNonOwnerPtr<::AppPlatform const> appPlatform,
173 ::std::function<
bool()>&& checkIsSafeToFlushCache
196 MCNAPI
void $renameLevel(::std::string
const& levelId, ::std::string
const& newLevelName);
199 ::std::string
const& levelId,
200 ::std::string
const& newLevelName,
207 ::std::string
const& levelId,
208 ::std::string
const& newLevelId,
209 ::std::string
const& newName
222 ::std::string
const& levelId,
224 ::Bedrock::NotNullNonOwnerPtr<::IContentKeyProvider const>
const& keyProvider,
225 ::std::chrono::nanoseconds
const& writeFlushInterval,
226 ::Bedrock::NotNullNonOwnerPtr<::LevelDbEnv> levelDbEnv,
227 ::std::unique_ptr<::LevelStorageEventing> levelStorageEventing
231 ::std::string
const& levelId,
233 ::Bedrock::NotNullNonOwnerPtr<::IContentKeyProvider const>
const& keyProvider
249 ::std::vector<::LevelSummary>& dest,
250 bool includeShallowSummaries,
251 bool includePartiallyCopiedLevels,
252 bool includeBetaRetailLevels,
253 bool includeInvalidLevelDataLevels
262 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: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 $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