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
10// auto generated forward declare list
11// clang-format off
12class PackManifest;
13class PackSettings;
15namespace Bedrock::PubSub { class Subscription; }
16namespace Bedrock::PubSub::ThreadModel { struct MultiThreaded; }
17namespace Core { class Path; }
18namespace Core { class PathView; }
19namespace SharedTypes::v1_21_100::PackSettingsDefinition { struct Document; }
20namespace mce { class UUID; }
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, 120, ::cereal::ReflectionCtx> mReflectionCtx;
57 ::ll::TypedStorage<
58 8,
59 192,
61 mLoader;
62 ::ll::TypedStorage<
63 8,
64 16,
65 ::std::shared_ptr<::Bedrock::PubSub::Publisher<
66 void(::mce::UUID const&, ::std::string const&, ::std::variant<float, bool, ::std::string> const&),
68 0>>>
69 mOnChangePublisher;
70 ::ll::TypedStorage<8, 8, ::std::unique_ptr<::std::unordered_map<::mce::UUID, ::std::unique_ptr<::PackSettings>>>>
71 mGlobalPackSettings;
72 ::ll::TypedStorage<
73 8,
74 64,
75 ::std::unordered_map<::std::string, ::std::unordered_map<::mce::UUID, ::std::unique_ptr<::PackSettings>>>>
76 mWorldPackSettings;
77 ::ll::TypedStorage<8, 8, ::std::unique_ptr<::SharedTypes::v1_21_100::PackSettingsDefinition::Document>>
78 mGlobalUserOverrides;
79 ::ll::TypedStorage<
80 8,
81 64,
82 ::std::
83 unordered_map<::std::string, ::std::unique_ptr<::SharedTypes::v1_21_100::PackSettingsDefinition::Document>>>
84 mPerWorldUserOverrides;
85 // NOLINTEND
86
87public:
88 // prevent constructor by default
89 PackSettingsFactory();
90
91public:
92 // virtual functions
93 // NOLINTBEGIN
94 virtual ~PackSettingsFactory();
95
96 virtual uint64 getAccessTimestamp() const;
97 // NOLINTEND
98
99public:
100 // member functions
101 // NOLINTBEGIN
102 MCAPI
103 PackSettingsFactory(uint64 maxGlobalPackSettingEntriesPerFile, ::std::optional<::Core::PathView> globalPathRoot);
104
105 MCAPI ::PackSettings* _getGlobalPackSettings(::PackManifest const& manifest);
106
107 MCAPI ::std::unordered_map<::mce::UUID, ::std::unique_ptr<::PackSettings>>&
108 _getWorldIdToPackSettingsMap(::std::string const& worldId);
109
110 MCAPI ::PackSettings* _getWorldPackSettings(::PackManifest const& manifest, ::std::optional<::std::string> worldId);
111
112 MCAPI ::std::unique_ptr<::SharedTypes::v1_21_100::PackSettingsDefinition::Document>
113 _loadUserOverridesFromFile(::Core::Path const& path) const;
114
115 MCAPI_C bool _saveUserOverridesToFile(
117 ::Core::Path const& path
118 ) const;
119
120 MCAPI_C void _syncPackSettingsToSaveDoc(
121 ::mce::UUID packId,
122 ::PackSettings const& packSettings,
124 bool includeTimestamp
125 ) const;
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 MCAPI_C ::Bedrock::PubSub::Subscription registerObserver(
132 ::std::function<
133 void(::mce::UUID const&, ::std::string const&, ::std::variant<float, bool, ::std::string> const&)> callback
134 );
135
136 MCAPI_C bool saveGlobalUserOverrides();
137
138 MCAPI_C bool savePerWorldUserOverrides(::std::string const& worldId, ::Core::Path const& worldPath);
139
140 MCAPI_C ::std::string serializePackSettingsNameValueMap(
141 ::std::unordered_map<::std::string, ::PackSettingValueAndDefault> const& packSettingsNameValueMap
142 ) const;
143 // NOLINTEND
144
145public:
146 // static variables
147 // NOLINTBEGIN
148 MCAPI static ::std::string_view const& GLOBAL_RESOURCE_PACK_SETTINGS_FILENAME();
149
150 MCAPI static ::std::string_view const& WORLD_BEHAVIOR_PACK_SETTINGS_FILENAME();
151 // NOLINTEND
152
153public:
154 // constructor thunks
155 // NOLINTBEGIN
156 MCAPI void* $ctor(uint64 maxGlobalPackSettingEntriesPerFile, ::std::optional<::Core::PathView> globalPathRoot);
157 // NOLINTEND
158
159public:
160 // destructor thunk
161 // NOLINTBEGIN
162 MCAPI void $dtor();
163 // NOLINTEND
164
165public:
166 // virtual function thunks
167 // NOLINTBEGIN
168 MCAPI uint64 $getAccessTimestamp() const;
169
170
171 // NOLINTEND
172
173public:
174 // vftables
175 // NOLINTBEGIN
176 MCNAPI static void** $vftable();
177 // NOLINTEND
178};
Definition Publisher.h:8
Definition Subscription.h:10
Definition PathView.h:17
Definition Path.h:10
Definition PackManifest.h:37
static MCAPI void ** $vftable()
Definition PackSettings.h:19
Definition _HeaderOutputPredefine.h:293
Definition UUID.h:7
Definition PackSettingValueAndDefault.h:5
Definition PackSettingsFactory.h:31
Definition Alias.h:14