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 Core { class PathView; }
20namespace SharedTypes::v1_26_40::PackSettingsDefinition { struct Document; }
21// clang-format on
22
23class PackSettingsFactory {
24public:
25 // PackSettingsFactory inner types declare
26 // clang-format off
27 struct Stats;
28 // clang-format on
29
30 // PackSettingsFactory inner types define
31 struct Stats {
32 public:
33 // member variables
34 // NOLINTBEGIN
39 // NOLINTEND
40
41 public:
42 // prevent constructor by default
43 Stats& operator=(Stats const&);
44 Stats(Stats const&);
45 Stats();
46 };
47
48 using PackIdToSettingsMap = ::std::unordered_map<::mce::UUID, ::std::unique_ptr<::PackSettings>>;
49
50public:
51 // member variables
52 // NOLINTBEGIN
53 ::ll::TypedStorage<8, 8, uint64 const> mMaxGlobalPackSettingEntriesPerFile;
54 ::ll::TypedStorage<8, 32, ::Core::PathBuffer<::std::string>> mGlobalPackSettingsPath;
55 ::ll::TypedStorage<4, 16, ::PackSettingsFactory::Stats> mStats;
56 ::ll::TypedStorage<8, 128, ::cereal::ReflectionCtx> mReflectionCtx;
57 ::ll::TypedStorage<
58 8,
59 264,
62 nullptr_t,
63 nullptr_t,
64 nullptr_t,
66 mLoader;
67 ::ll::TypedStorage<
68 8,
69 16,
70 ::std::shared_ptr<::Bedrock::PubSub::Publisher<
71 void(
72 ::mce::UUID const&,
73 ::std::string const&,
74 ::std::variant<float, bool, ::std::string, ::std::vector<::std::string>> const&
75 ),
77 0>>>
78 mOnChangePublisher;
79 ::ll::TypedStorage<
80 8,
81 8,
82 ::std::unique_ptr<::std::unordered_map<
84 ::std::unique_ptr<::PackSettings, ::std::default_delete<::PackSettings>>>>>
85 mGlobalPackSettings;
86 ::ll::TypedStorage<
87 8,
88 64,
89 ::std::unordered_map<::std::string, ::std::unordered_map<::mce::UUID, ::std::unique_ptr<::PackSettings>>>>
90 mWorldPackSettings;
91 ::ll::TypedStorage<8, 8, ::std::unique_ptr<::SharedTypes::v1_26_40::PackSettingsDefinition::Document>>
92 mGlobalUserOverrides;
93 ::ll::TypedStorage<
94 8,
95 64,
96 ::std::
97 unordered_map<::std::string, ::std::unique_ptr<::SharedTypes::v1_26_40::PackSettingsDefinition::Document>>>
98 mPerWorldUserOverrides;
99 // NOLINTEND
100
101public:
102 // prevent constructor by default
103 PackSettingsFactory();
104
105public:
106 // virtual functions
107 // NOLINTBEGIN
108 virtual ~PackSettingsFactory() = default;
109
110 virtual uint64 getAccessTimestamp() const;
111 // NOLINTEND
112
113public:
114 // member functions
115 // NOLINTBEGIN
116 MCAPI
117 PackSettingsFactory(uint64 maxGlobalPackSettingEntriesPerFile, ::std::optional<::Core::PathView> globalPathRoot);
118
119 MCAPI ::PackSettings* _getGlobalPackSettings(::PackManifest const& manifest);
120
121 MCAPI ::PackSettings* _getWorldPackSettings(::PackManifest const& manifest, ::std::optional<::std::string> worldId);
122
123 MCAPI ::std::unique_ptr<::SharedTypes::v1_26_40::PackSettingsDefinition::Document>
124 _loadUserOverridesFromFile(::Core::Path const& path) const;
125
126#ifdef LL_PLAT_C
127 MCAPI bool _saveUserOverridesToFile(
129 ::Core::Path const& path
130 ) const;
131
132 MCAPI void _syncPackSettingsToSaveDoc(
133 ::mce::UUID packId,
134 ::PackSettings const& packSettings,
136 bool includeTimestamp
137 ) const;
138#endif
139
140 MCAPI ::PackSettings* getPackSettings(::PackManifest const& manifest, ::std::optional<::std::string> worldId);
141
142 MCAPI bool loadPerWorldUserOverrides(::std::string const& worldId, ::Core::Path const& worldPath);
143
144#ifdef LL_PLAT_C
145 MCAPI bool saveGlobalUserOverrides();
146
147 MCAPI bool savePerWorldUserOverrides(::std::string const& worldId, ::Core::Path const& worldPath);
148
149 MCAPI ::std::string serializePackSettingsNameValueMap(
150 ::std::unordered_map<::std::string, ::PackSettingValueAndDefault> const& packSettingsNameValueMap
151 ) const;
152#endif
153 // NOLINTEND
154
155public:
156 // static variables
157 // NOLINTBEGIN
158 MCAPI static ::brstd::basic_cstring_view<char, ::std::char_traits<char>> const&
159 GLOBAL_RESOURCE_PACK_SETTINGS_FILENAME();
160
161 MCAPI static ::brstd::basic_cstring_view<char, ::std::char_traits<char>> const&
162 WORLD_BEHAVIOR_PACK_SETTINGS_FILENAME();
163 // NOLINTEND
164
165public:
166 // constructor thunks
167 // NOLINTBEGIN
168 MCAPI void* $ctor(uint64 maxGlobalPackSettingEntriesPerFile, ::std::optional<::Core::PathView> globalPathRoot);
169 // NOLINTEND
170
171public:
172 // virtual function thunks
173 // NOLINTBEGIN
174 MCFOLD uint64 $getAccessTimestamp() const;
175
176
177 // NOLINTEND
178};
Definition Publisher.h:25
Definition PathView.h:19
Definition Path.h:11
Definition PackManifest.h:39
Definition PackSettings.h:20
Definition _HeaderOutputPredefine.h:398
Definition UUID.h:8
Definition PackSettingValueAndDefault.h:5
Definition PackSettingsFactory.h:31
Definition Alias.h:14