LeviLamina
Loading...
Searching...
No Matches
LevelStorageSource.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/utility/EnableNonOwnerReferences.h"
8#include "mc/deps/core/utility/NonOwnerPointer.h"
9#include "mc/deps/core/utility/UniqueOwnerPointer.h"
10#include "mc/platform/Result.h"
11#include "mc/world/level/storage/LevelDataLoadResult.h"
12
13// auto generated forward declare list
14// clang-format off
15class ContentIdentity;
17class LevelData;
18class LevelDbEnv;
20class LevelStorage;
22class Scheduler;
23struct LevelInfoPath;
24namespace Core { class Path; }
25// clang-format on
26
28public:
29 // virtual functions
30 // NOLINTBEGIN
31 virtual ~LevelStorageSource() /*override*/ = default;
32
33 virtual ::std::string const& getName() const = 0;
34
35 virtual ::Bedrock::Result<::LevelDataLoadResult>
36 getLevelData(::std::string const& levelId, ::LevelData& levelDataOut) const = 0;
37
38 virtual void saveLevelData(::std::string const& levelId, ::LevelData const& data) = 0;
39
40 virtual void getLevelList(::std::vector<::Core::PathBuffer<::std::string>>& paths) = 0;
41
42 virtual ::Bedrock::UniqueOwnerPointer<::LevelStorage> createLevelStorage(
43 ::Scheduler& scheduler,
44 ::std::string const& levelId,
45 ::ContentIdentity const& contentIdentity,
46 ::Bedrock::NotNullNonOwnerPtr<::IContentKeyProvider const> const& keyProvider,
47 ::std::chrono::nanoseconds const& writeFlushInterval,
48 ::Bedrock::NotNullNonOwnerPtr<::LevelDbEnv> levelDbEnv,
49 ::std::unique_ptr<::LevelStorageEventing> levelStorageEventing,
50 bool jigsawPersistenceToggle
51 ) = 0;
52
53 virtual ::std::unique_ptr<::LevelLooseFileStorage> createLevelLooseStorage(
54 ::std::string const& levelId,
55 ::ContentIdentity const& contentIdentity,
56 ::Bedrock::NotNullNonOwnerPtr<::IContentKeyProvider const> const& keyProvider
57 ) = 0;
58
59 virtual void deleteLevel(::std::string const& levelId) = 0;
60
61 virtual bool renameLevel(::std::string const& levelId, ::std::string const& newLevelName) = 0;
62
63 virtual void
64 renameLevel(::LevelData& levelData, ::Core::Path const& fullPath, ::std::string const& newLevelName) = 0;
65
66 virtual bool createBackupCopyOfWorld(
67 ::std::string const& levelId,
68 ::std::string const& newLeveId,
69 ::std::string const& newName
70 ) = 0;
71
72 virtual bool isLevelMarkedForSync(::Core::Path const& levelPath) const = 0;
73
74 virtual bool isLevelPartiallyCopied(::Core::Path const& levelPath) const = 0;
75
76 virtual ::Core::PathBuffer<::std::string> getLevelDatFoundPath(::Core::Path const& levelPath) const = 0;
77
78 virtual ::Core::PathBuffer<::std::string> const getBasePath() const = 0;
79
80 virtual ::Core::PathBuffer<::std::string> const getPathToLevel(::std::string const& levelId) const = 0;
81
82 virtual ::LevelInfoPath getPathToLevelInfo(::std::string const&, bool) const = 0;
83
84 virtual ::std::string getLevelIdFromPath(::Core::Path const& fullPath, ::Core::Path const& worldsPath) const = 0;
85
86 virtual bool isBetaRetailLevel(::std::string const&) const = 0;
87
88 virtual void ensureLevelInitialized(::std::string const&);
89 // NOLINTEND
90
91public:
92 // static variables
93 // NOLINTBEGIN
94 MCNAPI static ::std::chrono::nanoseconds const& WORLD_SAVE_FLUSH_INTERVAL();
95
96 MCNAPI static ::std::chrono::nanoseconds const& WORLD_SAVE_MENU_FLUSH_INTERVAL();
97 // NOLINTEND
98
99public:
100 // virtual function thunks
101 // NOLINTBEGIN
102 MCNAPI void $ensureLevelInitialized(::std::string const&);
103
104
105 // NOLINTEND
106};
Definition EnableNonOwnerReferences.h:7
Definition ContentIdentity.h:8
Definition PathBuffer.h:8
Definition Path.h:11
Definition IContentKeyProvider.h:13
Definition LevelData.h:55
Definition LevelDbEnv.h:8
Definition LevelLooseFileStorage.h:15
Definition LevelStorageEventing.h:16
Definition LevelStorageSource.h:27
static MCAPI ::std::chrono::nanoseconds const & WORLD_SAVE_FLUSH_INTERVAL()
static MCAPI ::std::chrono::nanoseconds const & WORLD_SAVE_MENU_FLUSH_INTERVAL()
MCAPI void $ensureLevelInitialized(::std::string const &)
Definition LevelStorage.h:25
Definition Scheduler.h:14
Definition LevelInfoPath.h:5