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
39 struct DefEntry {
40 public:
41 // member variables
42 // NOLINTBEGIN
43 ::ll::TypedStorage<4, 4, int> collectionIndex;
44 ::ll::TypedStorage<8, 32, ::std::string> ns;
45 ::ll::TypedStorage<8, 32, ::std::string> name;
46 ::ll::TypedStorage<8, 32, ::std::string> refNs;
47 ::ll::TypedStorage<8, 32, ::std::string> refName;
48 ::ll::TypedStorage<8, 16, ::Json::Value> jsonVal;
49 // NOLINTEND
50 };
51
52 using VisitNodeFunc = ::std::function<
53 ::Json::Value&(::std::string const&, ::std::string const&, ::std::string const&, ::Json::Value&)>;
54
55 using DefEntriesPtr = ::std::shared_ptr<::std::vector<::UIDefRepository::DefEntry>>;
56
57 using ReportsPtr = ::std::shared_ptr<::std::vector<::PackReport>>;
58
59 using UIDefNamespaceMap = ::std::unordered_map<::std::string, ::UIDefRepository::UIDefNamespace>;
60
61public:
62 // member variables
63 // NOLINTBEGIN
64 ::ll::TypedStorage<8, 24, ::Bedrock::NotNullNonOwnerPtr<::ResourceLoadManager>> mResourceLoadManager;
65 ::ll::TypedStorage<8, 64, ::std::unordered_map<::std::string, ::UIDefRepository::UIDefNamespace>> mDefNamespaces;
66 ::ll::TypedStorage<8, 16, ::Json::Value> mGlobalVariables;
67 ::ll::TypedStorage<8, 8, ::std::shared_mutex> mMutex;
68 // NOLINTEND
69
70public:
71 // prevent constructor by default
72 UIDefRepository();
73
74public:
75 // virtual functions
76 // NOLINTBEGIN
77 virtual void loadDefsList(
78 ::ResourceLocation const& defsListFile,
79 ::ResourcePackStack const& packStack,
80 ::std::function<void(::std::vector<::PackReport>&)> onReportsReady
81 ) /*override*/;
82
83 virtual void validateDefEntries(
84 ::ResourceLocation const& defsListFile,
85 ::std::shared_ptr<::ResourcePackStack const> packStack,
86 ::std::function<void(::std::vector<::PackReport>&)> onReportsReady
87 ) const /*override*/;
88
89 virtual ::Json::Value const& findDef(::std::string const& defNamespace, ::std::string const& defName) const
90 /*override*/;
91
92 virtual ::Bedrock::Threading::SharedLock<::std::shared_mutex> acquireSharedLock() const /*override*/;
93
94 virtual void syncUILoad() /*override*/;
95
96 virtual void syncUILoadDefinitions() /*override*/;
97
98 virtual void syncUILoadDefinitionReferences() /*override*/;
99
100 virtual void cancelUIValidation() /*override*/;
101
102 virtual bool isLoadingDone() const /*override*/;
103
104 virtual bool isUILoadingDone() const /*override*/;
105
106 virtual bool isUIValidationDone() const /*override*/;
107
108 virtual void
109 forEachControl(::std::function<void(::Json::Value const&, ::std::string const&)> callback) /*override*/;
110
111 virtual ::Json::Value const& getGlobalVariables() const /*override*/;
112
113 virtual void translateLegacyItemIdsInRepository(::ItemRegistryRef const itemRegistry) /*override*/;
114 // NOLINTEND
115
116public:
117 // member functions
118 // NOLINTBEGIN
119 MCAPI explicit UIDefRepository(::Bedrock::NotNullNonOwnerPtr<::ResourceLoadManager> resourceLoadManager);
120
121 MCAPI void _applyGlobalColorFormat();
122
123 MCAPI void _collectAllDefEntries(
124 ::ResourceLoadType loadType,
125 ::ResourceLocation const& defsListFile,
126 ::ResourcePackStack const& packStack,
127 ::std::shared_ptr<::std::vector<::UIDefRepository::DefEntry>> allDefEntries,
128 ::std::shared_ptr<::std::vector<::PackReport>> packReports
129 ) const;
130
131 MCAPI void _forEachControl(
132 ::Json::Value const& value,
133 ::std::string const& namePath,
134 ::std::function<void(::Json::Value const&, ::std::string const&)> callback
135 );
136 // NOLINTEND
137
138public:
139 // constructor thunks
140 // NOLINTBEGIN
141 MCAPI void* $ctor(::Bedrock::NotNullNonOwnerPtr<::ResourceLoadManager> resourceLoadManager);
142 // NOLINTEND
143
144public:
145 // virtual function thunks
146 // NOLINTBEGIN
147 MCAPI void $loadDefsList(
148 ::ResourceLocation const& defsListFile,
149 ::ResourcePackStack const& packStack,
150 ::std::function<void(::std::vector<::PackReport>&)> onReportsReady
151 );
152
153 MCAPI void $validateDefEntries(
154 ::ResourceLocation const& defsListFile,
155 ::std::shared_ptr<::ResourcePackStack const> packStack,
156 ::std::function<void(::std::vector<::PackReport>&)> onReportsReady
157 ) const;
158
159 MCAPI ::Json::Value const& $findDef(::std::string const& defNamespace, ::std::string const& defName) const;
160
161 MCAPI ::Bedrock::Threading::SharedLock<::std::shared_mutex> $acquireSharedLock() const;
162
163 MCAPI void $syncUILoad();
164
165 MCAPI void $syncUILoadDefinitions();
166
167 MCAPI void $syncUILoadDefinitionReferences();
168
169 MCAPI void $cancelUIValidation();
170
171 MCAPI bool $isLoadingDone() const;
172
173 MCAPI bool $isUILoadingDone() const;
174
175 MCAPI bool $isUIValidationDone() const;
176
177 MCAPI void $forEachControl(::std::function<void(::Json::Value const&, ::std::string const&)> callback);
178
179 MCFOLD ::Json::Value const& $getGlobalVariables() const;
180
181 MCAPI void $translateLegacyItemIdsInRepository(::ItemRegistryRef const itemRegistry);
182 // NOLINTEND
183};
Definition IUIDefRepository.h:5
Definition ItemRegistryRef.h:41
Definition PackReport.h:17
Definition ResourceLoadManager.h:18
Definition ResourceLocation.h:15
Definition ResourcePackStack.h:26
Definition UIDefRepository.h:14
Definition UIDefRepository.h:5
Definition UIDefRepository.h:16