LeviLamina
Loading...
Searching...
No Matches
FeatureRegistry.h
1#pragma once
2
3#include "mc/_HeaderOutputPredefine.h"
4
5// auto generated inclusion list
6#include "mc/deps/core/utility/NonOwnerPointer.h"
7#include "mc/deps/game_refs/OwnerPtr.h"
8#include "mc/deps/game_refs/WeakRef.h"
9#include "mc/platform/brstd/function_ref.h"
10
11// auto generated forward declare list
12// clang-format off
13class HashedString;
14class IFeature;
19namespace Json { class Value; }
20// clang-format on
21
22class FeatureRegistry {
23public:
24 // FeatureRegistry inner types declare
25 // clang-format off
27 // clang-format on
28
29 // FeatureRegistry inner types define
30 struct FeatureBinaryJsonFormat {
31 public:
32 // member variables
33 // NOLINTBEGIN
34 ::ll::TypedStorage<8, 32, ::std::string> featureName;
35 ::ll::TypedStorage<8, 32, ::std::string> binaryJsonOutput;
36 // NOLINTEND
37
38 public:
39 // prevent constructor by default
40 FeatureBinaryJsonFormat& operator=(FeatureBinaryJsonFormat const&);
41 FeatureBinaryJsonFormat();
42
43 public:
44 // member functions
45 // NOLINTBEGIN
46 MCAPI FeatureBinaryJsonFormat(::FeatureRegistry::FeatureBinaryJsonFormat const&);
47
48 MCFOLD ::FeatureRegistry::FeatureBinaryJsonFormat& operator=(::FeatureRegistry::FeatureBinaryJsonFormat&&);
49
50 MCAPI bool operator==(::FeatureRegistry::FeatureBinaryJsonFormat const& rhs) const;
51
52 MCAPI ~FeatureBinaryJsonFormat();
53 // NOLINTEND
54
55 public:
56 // constructor thunks
57 // NOLINTBEGIN
58 MCFOLD void* $ctor(::FeatureRegistry::FeatureBinaryJsonFormat const&);
59 // NOLINTEND
60
61 public:
62 // destructor thunk
63 // NOLINTBEGIN
64 MCFOLD void $dtor();
65 // NOLINTEND
66 };
67
68public:
69 // member variables
70 // NOLINTBEGIN
71 ::ll::TypedStorage<8, 24, ::Bedrock::NonOwnerPointer<::LinkedAssetValidator>> mValidator;
72 ::ll::TypedStorage<8, 24, ::std::vector<::std::unique_ptr<::IFeature>>> mFeatureRegistry;
73 ::ll::TypedStorage<8, 24, ::std::vector<::OwnerPtr<::IFeature>>> mFeatureSlots;
74 ::ll::TypedStorage<8, 64, ::std::unordered_map<::HashedString, uint64>> mFeatureLookupMap;
75 ::ll::TypedStorage<8, 24, ::std::vector<::FeatureRegistry::FeatureBinaryJsonFormat>> mFeatureSerializeData;
76 ::ll::TypedStorage<1, 1, bool> mClientInitialized;
77 ::ll::TypedStorage<8, 24, ::std::vector<::std::string>> mLargeFeaturePasses;
78 ::ll::TypedStorage<8, 24, ::std::vector<::std::string>> mSmallFeaturePasses;
79 // NOLINTEND
80
81public:
82 // prevent constructor by default
83 FeatureRegistry();
84
85public:
86 // member functions
87 // NOLINTBEGIN
88 MCAPI explicit FeatureRegistry(::Bedrock::NonOwnerPointer<::LinkedAssetValidator> validator);
89
90 MCAPI void _registerFeature(::std::string const& name, ::std::unique_ptr<::IFeature> featurePtr);
91
92#ifdef LL_PLAT_C
93 MCAPI bool _setupFeature(
94 ::IWorldRegistriesProvider& worldRegistries,
95 bool isBasePack,
96 ::ResourcePackManager const& rpm,
97 ::std::string const& featureName,
98 ::std::string const& jsonDefinition,
99 ::MinEngineVersion const& minEngineVersion,
100 bool serializeFeatures
101 );
102#endif
103
104 MCAPI bool _setupFeature(
105 ::IWorldRegistriesProvider& worldRegistries,
106 bool isBasePack,
107 ::ResourcePackManager const& rpm,
108 ::std::string const& featureName,
109 ::Json::Value const& jsonDefinition,
110 ::MinEngineVersion const& minEngineVersion,
111 bool serializeFeatures
112 );
113
114 MCAPI void forEachFeature(::brstd::function_ref<void(::HashedString const&, ::WeakRef<::IFeature>)> callback) const;
115
116 MCAPI ::std::vector<::std::string> getLargeFeaturePasses() const;
117
118 MCAPI ::std::vector<::std::string> getSmallFeaturePasses() const;
119
120 MCAPI bool isFeaturePassDefined(::std::string const& featurePass) const;
121
122 MCAPI void loadFromDefinitions(
123 ::IWorldRegistriesProvider& worldRegistries,
124 ::ResourcePackManager const& rpm,
125 bool clientSideGenEnabled
126 );
127
128#ifdef LL_PLAT_C
129 MCAPI void loadFromJsonData(
130 ::IWorldRegistriesProvider& worldRegistries,
131 ::ResourcePackManager const& rpm,
132 ::std::vector<::FeatureRegistry::FeatureBinaryJsonFormat> const& jsonData
133 );
134#endif
135
136 MCAPI ::WeakRef<::IFeature> lookupByName(::std::string const& name) const;
137
138 MCAPI ::WeakRef<::IFeature> lookupOrReserveFeature(::std::string const& featureName);
139
140 MCAPI ::WeakRef<::IFeature> reserveFeature(::std::string const& name);
141
142 MCAPI ::std::string const& reverseLookupString(::IFeature const& feature) const;
143
144 MCAPI void setLargeFeaturePasses(::std::vector<::std::string> largeFeaturePasses);
145
146 MCAPI void setSmallFeaturePasses(::std::vector<::std::string> smallFeaturePasses);
147
148 MCAPI ~FeatureRegistry();
149 // NOLINTEND
150
151public:
152 // static functions
153 // NOLINTBEGIN
154 MCAPI static ::std::string
155 _featureIdentifierFromInput(::std::string_view filePath, ::Json::Value const& jsonDefinition);
156 // NOLINTEND
157
158public:
159 // static variables
160 // NOLINTBEGIN
161 MCAPI static ::std::string const& AFTER_SKY_PASS();
162
163 MCAPI static ::std::string const& AFTER_SURFACE_PASS();
164
165 MCAPI static ::std::string const& AFTER_UNDERGROUND_PASS();
166
167 MCAPI static ::std::string const& BEFORE_SKY_PASS();
168
169 MCAPI static ::std::string const& BEFORE_SURFACE_PASS();
170
171 MCAPI static ::std::string const& BEFORE_UNDERGROUND_PASS();
172
173 MCAPI static ::std::string const& FINAL_PASS();
174
175 MCAPI static ::std::string const& FIRST_PASS();
176
177 MCAPI static ::std::string const& PREGENERATION_PASS();
178
179 MCAPI static ::std::string const& SKY_PASS();
180
181 MCAPI static ::std::string const& SURFACE_PASS();
182
183 MCAPI static ::std::string const& UNDERGROUND_PASS();
184 // NOLINTEND
185
186public:
187 // constructor thunks
188 // NOLINTBEGIN
189 MCAPI void* $ctor(::Bedrock::NonOwnerPointer<::LinkedAssetValidator> validator);
190 // NOLINTEND
191
192public:
193 // destructor thunk
194 // NOLINTBEGIN
195 MCAPI void $dtor();
196 // NOLINTEND
197};
Definition NonOwnerPointer.h:9
Definition HashedString.h:5
Definition IFeature.h:19
Definition IWorldRegistriesProvider.h:25
Definition Value.h:16
Definition LinkedAssetValidator.h:8
Definition MinEngineVersion.h:15
Definition ResourcePackManager.h:35
Definition WeakRef.h:8
Definition function_ref.h:60
Definition FeatureRegistry.h:30