LeviLamina
Loading...
Searching...
No Matches
UIDefRepository.h
1#pragma once
2
3#include "mc/_HeaderOutputPredefine.h"
4
5// auto generated inclusion list
6#include "mc/client/gui/interface/IUIDefRepository.h"
7#include "mc/deps/core/utility/NonOwnerPointer.h"
8#include "mc/deps/json/Value.h"
9#include "mc/platform/threading/SharedLock.h"
10#include "mc/resources/ResourceLoadType.h"
11
12// auto generated forward declare list
13// clang-format off
14class ItemRegistryRef;
15class PackReport;
19// clang-format on
20
22public:
23 // UIDefRepository inner types declare
24 // clang-format off
25 class UIDefNamespace;
26 struct DefEntry;
27 // clang-format on
28
29 // UIDefRepository inner types define
30 class UIDefNamespace {
31 public:
32 // member variables
33 // NOLINTBEGIN
34 ::ll::TypedStorage<8, 32, ::std::string> mName;
35 ::ll::TypedStorage<8, 64, ::std::unordered_map<::std::string, ::Json::Value>> mDefs;
36 // NOLINTEND
37
38 public:
39 // member functions
40 // NOLINTBEGIN
41 MCAPI ~UIDefNamespace();
42 // NOLINTEND
43
44 public:
45 // destructor thunk
46 // NOLINTBEGIN
47 MCAPI void $dtor();
48 // NOLINTEND
49 };
50
51 struct DefEntry {
52 public:
53 // member variables
54 // NOLINTBEGIN
55 ::ll::TypedStorage<4, 4, int> collectionIndex;
56 ::ll::TypedStorage<8, 32, ::std::string> ns;
57 ::ll::TypedStorage<8, 32, ::std::string> name;
58 ::ll::TypedStorage<8, 32, ::std::string> refNs;
59 ::ll::TypedStorage<8, 32, ::std::string> refName;
60 ::ll::TypedStorage<8, 16, ::Json::Value> jsonVal;
61 // NOLINTEND
62
63 public:
64 // prevent constructor by default
65 DefEntry& operator=(DefEntry const&);
66 DefEntry(DefEntry const&);
67 DefEntry();
68
69 public:
70 // member functions
71 // NOLINTBEGIN
72 MCAPI DefEntry(::UIDefRepository::DefEntry&&);
73
74 MCAPI ~DefEntry();
75 // NOLINTEND
76
77 public:
78 // constructor thunks
79 // NOLINTBEGIN
80 MCAPI void* $ctor(::UIDefRepository::DefEntry&&);
81 // NOLINTEND
82
83 public:
84 // destructor thunk
85 // NOLINTBEGIN
86 MCAPI void $dtor();
87 // NOLINTEND
88 };
89
90 using VisitNodeFunc = ::std::function<
91 ::Json::Value&(::std::string const&, ::std::string const&, ::std::string const&, ::Json::Value&)>;
92
93 using DefEntriesPtr = ::std::shared_ptr<::std::vector<::UIDefRepository::DefEntry>>;
94
95 using ReportsPtr = ::std::shared_ptr<::std::vector<::PackReport>>;
96
97 using UIDefNamespaceMap = ::std::unordered_map<::std::string, ::UIDefRepository::UIDefNamespace>;
98
99public:
100 // member variables
101 // NOLINTBEGIN
102 ::ll::TypedStorage<8, 24, ::Bedrock::NotNullNonOwnerPtr<::ResourceLoadManager>> mResourceLoadManager;
103 ::ll::TypedStorage<8, 64, ::std::unordered_map<::std::string, ::UIDefRepository::UIDefNamespace>> mDefNamespaces;
104 ::ll::TypedStorage<8, 16, ::Json::Value> mGlobalVariables;
105 ::ll::TypedStorage<8, 8, ::std::shared_mutex> mMutex;
106 // NOLINTEND
107
108public:
109 // prevent constructor by default
110 UIDefRepository();
111
112public:
113 // virtual functions
114 // NOLINTBEGIN
115 virtual void loadDefsList(
116 ::ResourceLocation const& defsListFile,
117 ::ResourcePackStack const& packStack,
118 ::std::function<void(::std::vector<::PackReport>&)> onReportsReady
119 ) /*override*/;
120
121 virtual void validateDefEntries(
122 ::ResourceLocation const& defsListFile,
123 ::std::shared_ptr<::ResourcePackStack const> packStack,
124 ::std::function<void(::std::vector<::PackReport>&)> onReportsReady
125 ) const /*override*/;
126
127 virtual ::Json::Value const& findDef(::std::string const& defNamespace, ::std::string const& defName) const
128 /*override*/;
129
130 virtual ::Bedrock::Threading::SharedLock<::std::shared_mutex> acquireSharedLock() const /*override*/;
131
132 virtual void syncUILoad() /*override*/;
133
134 virtual void syncUILoadDefinitions() /*override*/;
135
136 virtual void syncUILoadDefinitionReferences() /*override*/;
137
138 virtual void cancelUIValidation() /*override*/;
139
140 virtual bool isLoadingDone() const /*override*/;
141
142 virtual bool isUILoadingDone() const /*override*/;
143
144 virtual bool isUIValidationDone() const /*override*/;
145
146 virtual void
147 forEachControl(::std::function<void(::Json::Value const&, ::std::string const&)> callback) /*override*/;
148
149 virtual ::Json::Value const& getGlobalVariables() const /*override*/;
150
151 virtual void translateLegacyItemIdsInRepository(::ItemRegistryRef const itemRegistry) /*override*/;
152
153 virtual ~UIDefRepository() /*override*/;
154 // NOLINTEND
155
156public:
157 // member functions
158 // NOLINTBEGIN
159 MCAPI explicit UIDefRepository(::Bedrock::NotNullNonOwnerPtr<::ResourceLoadManager> resourceLoadManager);
160
161 MCAPI void _applyGlobalColorFormat();
162
163 MCAPI void _collectAllDefEntries(
164 ::ResourceLoadType loadType,
165 ::ResourceLocation const& defsListFile,
166 ::ResourcePackStack const& packStack,
167 ::std::shared_ptr<::std::vector<::UIDefRepository::DefEntry>> allDefEntries,
168 ::std::shared_ptr<::std::vector<::PackReport>> packReports
169 ) const;
170
171 MCAPI void _forEachControl(
172 ::Json::Value const& value,
173 ::std::string const& namePath,
174 ::std::function<void(::Json::Value const&, ::std::string const&)> callback
175 );
176
177 MCAPI void _queueFinishLoad(
178 ::std::shared_ptr<::std::unordered_map<::std::string, ::UIDefRepository::UIDefNamespace>> defNamespaces,
179 ::std::shared_ptr<::std::vector<::PackReport>> packReportsPtr,
180 ::ResourcePackStack const& packStack,
181 ::std::function<void(::std::vector<::PackReport>&)> onReportsReady
182 );
183
184 MCAPI void _readGlobalVariables(::ResourcePackStack const& packStack);
185 // NOLINTEND
186
187public:
188 // static functions
189 // NOLINTBEGIN
190 MCAPI static void _resolveReferences(
191 ::UIDefRepository::DefEntry& defEntry,
192 ::std::vector<::UIDefRepository::DefEntry> const& allDefEntries,
193 ::std::vector<int> const& sortedDefEntries,
194 ::std::unordered_set<int>& visitedRefs,
195 ::std::vector<bool>& resolved
196 );
197 // NOLINTEND
198
199public:
200 // constructor thunks
201 // NOLINTBEGIN
202 MCAPI void* $ctor(::Bedrock::NotNullNonOwnerPtr<::ResourceLoadManager> resourceLoadManager);
203 // NOLINTEND
204
205public:
206 // destructor thunk
207 // NOLINTBEGIN
208 MCAPI void $dtor();
209 // NOLINTEND
210
211public:
212 // virtual function thunks
213 // NOLINTBEGIN
214 MCAPI void $loadDefsList(
215 ::ResourceLocation const& defsListFile,
216 ::ResourcePackStack const& packStack,
217 ::std::function<void(::std::vector<::PackReport>&)> onReportsReady
218 );
219
220 MCAPI void $validateDefEntries(
221 ::ResourceLocation const& defsListFile,
222 ::std::shared_ptr<::ResourcePackStack const> packStack,
223 ::std::function<void(::std::vector<::PackReport>&)> onReportsReady
224 ) const;
225
226 MCAPI ::Json::Value const& $findDef(::std::string const& defNamespace, ::std::string const& defName) const;
227
228 MCAPI ::Bedrock::Threading::SharedLock<::std::shared_mutex> $acquireSharedLock() const;
229
230 MCAPI void $syncUILoad();
231
232 MCAPI void $syncUILoadDefinitions();
233
234 MCAPI void $syncUILoadDefinitionReferences();
235
236 MCAPI void $cancelUIValidation();
237
238 MCAPI bool $isLoadingDone() const;
239
240 MCAPI bool $isUILoadingDone() const;
241
242 MCAPI bool $isUIValidationDone() const;
243
244 MCAPI void $forEachControl(::std::function<void(::Json::Value const&, ::std::string const&)> callback);
245
246 MCFOLD ::Json::Value const& $getGlobalVariables() const;
247
248 MCAPI void $translateLegacyItemIdsInRepository(::ItemRegistryRef const itemRegistry);
249 // NOLINTEND
250
251public:
252 // vftables
253 // NOLINTBEGIN
254 MCNAPI static void** $vftable();
255 // NOLINTEND
256};
Definition IUIDefRepository.h:5
Definition ItemRegistryRef.h:36
Definition PackReport.h:16
Definition ResourceLoadManager.h:19
Definition ResourceLocation.h:15
Definition ResourcePackStack.h:25
Definition UIDefRepository.h:14
Definition UIDefRepository.h:5
static MCAPI void ** $vftable()
Definition UIDefRepository.h:16