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 // prevent constructor by default
40 UIDefNamespace();
41
42 public:
43 // member functions
44 // NOLINTBEGIN
45 MCAPI explicit UIDefNamespace(::std::string const& name);
46
47 MCAPI ::Json::Value const& findDefInNamespace(::std::string const& defName) const;
48
49 MCAPI ~UIDefNamespace();
50 // NOLINTEND
51
52 public:
53 // constructor thunks
54 // NOLINTBEGIN
55 MCAPI void* $ctor(::std::string const& name);
56 // NOLINTEND
57
58 public:
59 // destructor thunk
60 // NOLINTBEGIN
61 MCFOLD void $dtor();
62 // NOLINTEND
63 };
64
65 struct DefEntry {
66 public:
67 // member variables
68 // NOLINTBEGIN
69 ::ll::TypedStorage<4, 4, int> collectionIndex;
70 ::ll::TypedStorage<8, 32, ::std::string> ns;
71 ::ll::TypedStorage<8, 32, ::std::string> name;
72 ::ll::TypedStorage<8, 32, ::std::string> refNs;
73 ::ll::TypedStorage<8, 32, ::std::string> refName;
74 ::ll::TypedStorage<8, 16, ::Json::Value> jsonVal;
75 // NOLINTEND
76
77 public:
78 // member functions
79 // NOLINTBEGIN
80 MCAPI ~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 // NOLINTEND
153
154public:
155 // member functions
156 // NOLINTBEGIN
157 MCAPI explicit UIDefRepository(::Bedrock::NotNullNonOwnerPtr<::ResourceLoadManager> resourceLoadManager);
158
159 MCAPI void _applyGlobalColorFormat();
160
161 MCAPI void _collectAllDefEntries(
162 ::ResourceLoadType loadType,
163 ::ResourceLocation const& defsListFile,
164 ::ResourcePackStack const& packStack,
165 ::std::shared_ptr<::std::vector<::UIDefRepository::DefEntry>> allDefEntries,
166 ::std::shared_ptr<::std::vector<::PackReport>> packReports
167 ) const;
168
169 MCAPI void _forEachControl(
170 ::Json::Value const& value,
171 ::std::string const& namePath,
172 ::std::function<void(::Json::Value const&, ::std::string const&)> callback
173 );
174
175 MCAPI void _queueFinishLoad(
176 ::std::shared_ptr<::std::unordered_map<::std::string, ::UIDefRepository::UIDefNamespace>> defNamespaces,
177 ::std::shared_ptr<::std::vector<::PackReport>> packReportsPtr,
178 ::ResourcePackStack const& packStack,
179 ::std::function<void(::std::vector<::PackReport>&)> onReportsReady
180 );
181
182 MCAPI void _readGlobalVariables(::ResourcePackStack const& packStack);
183 // NOLINTEND
184
185public:
186 // static functions
187 // NOLINTBEGIN
188 MCAPI static void _resolveReferences(
189 ::UIDefRepository::DefEntry& defEntry,
190 ::std::vector<::UIDefRepository::DefEntry> const& allDefEntries,
191 ::std::vector<int> const& sortedDefEntries,
192 ::std::unordered_set<int>& visitedRefs,
193 ::std::vector<bool>& resolved
194 );
195 // NOLINTEND
196
197public:
198 // constructor thunks
199 // NOLINTBEGIN
200 MCAPI void* $ctor(::Bedrock::NotNullNonOwnerPtr<::ResourceLoadManager> resourceLoadManager);
201 // NOLINTEND
202
203public:
204 // virtual function thunks
205 // NOLINTBEGIN
206 MCAPI void $loadDefsList(
207 ::ResourceLocation const& defsListFile,
208 ::ResourcePackStack const& packStack,
209 ::std::function<void(::std::vector<::PackReport>&)> onReportsReady
210 );
211
212 MCAPI void $validateDefEntries(
213 ::ResourceLocation const& defsListFile,
214 ::std::shared_ptr<::ResourcePackStack const> packStack,
215 ::std::function<void(::std::vector<::PackReport>&)> onReportsReady
216 ) const;
217
218 MCAPI ::Json::Value const& $findDef(::std::string const& defNamespace, ::std::string const& defName) const;
219
220 MCAPI ::Bedrock::Threading::SharedLock<::std::shared_mutex> $acquireSharedLock() const;
221
222 MCAPI void $syncUILoad();
223
224 MCAPI void $syncUILoadDefinitions();
225
226 MCAPI void $syncUILoadDefinitionReferences();
227
228 MCAPI void $cancelUIValidation();
229
230 MCAPI bool $isLoadingDone() const;
231
232 MCAPI bool $isUILoadingDone() const;
233
234 MCAPI bool $isUIValidationDone() const;
235
236 MCAPI void $forEachControl(::std::function<void(::Json::Value const&, ::std::string const&)> callback);
237
238 MCFOLD ::Json::Value const& $getGlobalVariables() const;
239
240 MCAPI void $translateLegacyItemIdsInRepository(::ItemRegistryRef const itemRegistry);
241 // NOLINTEND
242
243public:
244 // vftables
245 // NOLINTBEGIN
246 MCNAPI static void** $vftable();
247 // NOLINTEND
248};
Definition IUIDefRepository.h:5
Definition ItemRegistryRef.h:42
Definition PackReport.h:17
Definition ResourceLoadManager.h:19
Definition ResourceLocation.h:15
Definition ResourcePackStack.h:24
Definition UIDefRepository.h:14
Definition UIDefRepository.h:5
static MCAPI void ** $vftable()
Definition UIDefRepository.h:16