LeviLamina
Loading...
Searching...
No Matches
PackSettingsFactory.h
1#pragma once
2
3#include "mc/_HeaderOutputPredefine.h"
4
5// auto generated inclusion list
6#include "mc/deps/cereal/ReflectionCtx.h"
7#include "mc/deps/core/file/PathBuffer.h"
8#include "mc/deps/core/utility/pub_sub/Publisher.h"
9#include "mc/platform/UUID.h"
10#include "mc/platform/brstd/basic_cstring_view.h"
11
12// auto generated forward declare list
13// clang-format off
14class PackManifest;
15class PackSettings;
17namespace Bedrock::PubSub::ThreadModel { struct MultiThreaded; }
18namespace Core { class Path; }
19namespace SharedTypes::v1_21_100::PackSettingsDefinition { struct Document; }
20// clang-format on
21
23public:
24 // PackSettingsFactory inner types declare
25 // clang-format off
26 struct Stats;
27 // clang-format on
28
29 // PackSettingsFactory inner types define
30 struct Stats {
31 public:
32 // member variables
33 // NOLINTBEGIN
38 // NOLINTEND
39
40 public:
41 // prevent constructor by default
42 Stats& operator=(Stats const&);
43 Stats(Stats const&);
44 Stats();
45 };
46
47 using PackIdToSettingsMap = ::std::unordered_map<::mce::UUID, ::std::unique_ptr<::PackSettings>>;
48
49public:
50 // member variables
51 // NOLINTBEGIN
52 ::ll::TypedStorage<8, 8, uint64 const> mMaxGlobalPackSettingEntriesPerFile;
53 ::ll::TypedStorage<8, 32, ::Core::PathBuffer<::std::string>> mGlobalPackSettingsPath;
54 ::ll::TypedStorage<4, 16, ::PackSettingsFactory::Stats> mStats;
55 ::ll::TypedStorage<8, 128, ::cereal::ReflectionCtx> mReflectionCtx;
56 ::ll::TypedStorage<
57 8,
58 256,
61 nullptr_t,
62 nullptr_t,
64 mLoader;
65 ::ll::TypedStorage<
66 8,
67 16,
68 ::std::shared_ptr<::Bedrock::PubSub::Publisher<
69 void(::mce::UUID const&, ::std::string const&, ::std::variant<float, bool, ::std::string> const&),
71 0>>>
72 mOnChangePublisher;
73 ::ll::TypedStorage<
74 8,
75 8,
76 ::std::unique_ptr<::std::unordered_map<
78 ::std::unique_ptr<::PackSettings, ::std::default_delete<::PackSettings>>>>>
79 mGlobalPackSettings;
80 ::ll::TypedStorage<
81 8,
82 64,
83 ::std::unordered_map<::std::string, ::std::unordered_map<::mce::UUID, ::std::unique_ptr<::PackSettings>>>>
84 mWorldPackSettings;
85 ::ll::TypedStorage<8, 8, ::std::unique_ptr<::SharedTypes::v1_21_100::PackSettingsDefinition::Document>>
86 mGlobalUserOverrides;
87 ::ll::TypedStorage<
88 8,
89 64,
90 ::std::
91 unordered_map<::std::string, ::std::unique_ptr<::SharedTypes::v1_21_100::PackSettingsDefinition::Document>>>
92 mPerWorldUserOverrides;
93 // NOLINTEND
94
95public:
96 // virtual functions
97 // NOLINTBEGIN
98 virtual ~PackSettingsFactory() = default;
99
100 virtual uint64 getAccessTimestamp() const;
101 // NOLINTEND
102
103public:
104 // member functions
105 // NOLINTBEGIN
106 MCAPI ::PackSettings* _getGlobalPackSettings(::PackManifest const& manifest);
107
108 MCAPI ::PackSettings* _getWorldPackSettings(::PackManifest const& manifest, ::std::optional<::std::string> worldId);
109
110 MCAPI ::std::unique_ptr<::SharedTypes::v1_21_100::PackSettingsDefinition::Document>
111 _loadUserOverridesFromFile(::Core::Path const& path) const;
112
113#ifdef LL_PLAT_C
114 MCAPI bool _saveUserOverridesToFile(
116 ::Core::Path const& path
117 ) const;
118
119 MCAPI void _syncPackSettingsToSaveDoc(
120 ::mce::UUID packId,
121 ::PackSettings const& packSettings,
123 bool includeTimestamp
124 ) const;
125#endif
126
127 MCAPI ::PackSettings* getPackSettings(::PackManifest const& manifest, ::std::optional<::std::string> worldId);
128
129 MCAPI bool loadPerWorldUserOverrides(::std::string const& worldId, ::Core::Path const& worldPath);
130
131#ifdef LL_PLAT_C
132 MCAPI bool saveGlobalUserOverrides();
133
134 MCAPI bool savePerWorldUserOverrides(::std::string const& worldId, ::Core::Path const& worldPath);
135
136 MCAPI ::std::string serializePackSettingsNameValueMap(
137 ::std::unordered_map<::std::string, ::PackSettingValueAndDefault> const& packSettingsNameValueMap
138 ) const;
139#endif
140 // NOLINTEND
141
142public:
143 // static variables
144 // NOLINTBEGIN
145 MCAPI static ::brstd::basic_cstring_view<char, ::std::char_traits<char>> const&
146 GLOBAL_RESOURCE_PACK_SETTINGS_FILENAME();
147
148 MCAPI static ::brstd::basic_cstring_view<char, ::std::char_traits<char>> const&
149 WORLD_BEHAVIOR_PACK_SETTINGS_FILENAME();
150 // NOLINTEND
151
152public:
153 // virtual function thunks
154 // NOLINTBEGIN
155 MCFOLD uint64 $getAccessTimestamp() const;
156
157
158 // NOLINTEND
159};
Definition Publisher.h:25
Definition Path.h:11
Definition PackManifest.h:38
Definition PackSettingsFactory.h:22
Definition PackSettings.h:19
Definition _HeaderOutputPredefine.h:403
Definition UUID.h:7
Definition PackSettingValueAndDefault.h:5
Definition PackSettingsFactory.h:30
Definition Alias.h:14