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