LeviLamina
Loading...
Searching...
No Matches
StructurePoolElement.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/platform/brstd/once_flag.h"
8#include "mc/platform/threading/Mutex.h"
9#include "mc/util/Rotation.h"
10#include "mc/world/level/levelgen/structure/PostProcessSettings.h"
11#include "mc/world/level/levelgen/structure/Projection.h"
12#include "mc/world/level/levelgen/structure/structurepools/JigsawBlockInfo.h"
13#include "mc/world/level/levelgen/structure/structurepools/JigsawReplacement.h"
14#include "mc/world/level/levelgen/structure/structurepools/StructurePoolElementSettings.h"
15#include "mc/world/level/levelgen/structure/structurepools/StructurePoolElementType.h"
16#include "mc/world/level/levelgen/v2/LiquidSettings.h"
17
18// auto generated forward declare list
19// clang-format off
20class BlockPos;
21class BlockSource;
22class BoundingBox;
23class IRandom;
25class JigsawBlockInfo;
29class Random;
36namespace SharedTypes::v1_21_80 { struct JigsawStructureMetadata; }
37namespace br::worldgen { struct StructureProcessor; }
38// clang-format on
39
40class StructurePoolElement {
41public:
42 // StructurePoolElement inner types declare
43 // clang-format off
44 class ITemplate;
45 class LazyTemplate;
46 // clang-format on
47
48 // StructurePoolElement inner types define
49 class ITemplate {
50 public:
51 // virtual functions
52 // NOLINTBEGIN
53 virtual ~ITemplate() = default;
54
55 virtual ::std::vector<::JigsawBlockInfo> const& getJigsawMarkers() const = 0;
56
57 virtual ::BlockPos getSize(::Rotation rotation) const = 0;
58
59 virtual bool isLegacyStructure() const = 0;
60 // NOLINTEND
61
62 public:
63 // virtual function thunks
64 // NOLINTBEGIN
65
66 // NOLINTEND
67 };
68
69 class LazyTemplate : public ::StructurePoolElement::ITemplate {
70 public:
71 // member variables
72 // NOLINTBEGIN
73 ::ll::TypedStorage<
74 8,
75 16,
76 ::std::variant<
77 ::std::reference_wrapper<::StructureTemplate>,
78 ::std::reference_wrapper<::LegacyStructureTemplate>>>
79 mStructureVariant;
80 ::ll::TypedStorage<8, 24, ::std::vector<::JigsawBlockInfo>> mJigsawMarkers;
81 // NOLINTEND
82
83 public:
84 // prevent constructor by default
85 LazyTemplate();
86
87 public:
88 // virtual functions
89 // NOLINTBEGIN
90 virtual ::std::vector<::JigsawBlockInfo> const& getJigsawMarkers() const /*override*/;
91
92 virtual ::BlockPos getSize(::Rotation rotation) const /*override*/;
93
94 virtual bool isLegacyStructure() const /*override*/;
95 // NOLINTEND
96
97 public:
98 // member functions
99 // NOLINTBEGIN
100 MCAPI LazyTemplate(
101 ::Bedrock::NotNullNonOwnerPtr<::IStructureTemplateManager> manager,
102 ::std::string const& location,
103 ::std::vector<::std::unique_ptr<::StructurePoolBlockTagRule>> const* blockTagRules
104 );
105 // NOLINTEND
106
107 public:
108 // static functions
109 // NOLINTBEGIN
110 MCAPI static ::std::vector<::JigsawBlockInfo> _findJigsawBlocks(
111 ::std::vector<::JigsawStructureBlockInfo>& jigsawMarkers,
112 ::std::vector<::std::unique_ptr<::StructurePoolBlockTagRule>> const* blockTagRules
113 );
114 // NOLINTEND
115
116 public:
117 // constructor thunks
118 // NOLINTBEGIN
119 MCAPI void* $ctor(
120 ::Bedrock::NotNullNonOwnerPtr<::IStructureTemplateManager> manager,
121 ::std::string const& location,
122 ::std::vector<::std::unique_ptr<::StructurePoolBlockTagRule>> const* blockTagRules
123 );
124 // NOLINTEND
125
126 public:
127 // virtual function thunks
128 // NOLINTBEGIN
129 MCFOLD ::std::vector<::JigsawBlockInfo> const& $getJigsawMarkers() const;
130
131 MCAPI ::BlockPos $getSize(::Rotation rotation) const;
132
133 MCAPI bool $isLegacyStructure() const;
134
135
136 // NOLINTEND
137
138 public:
139 // vftables
140 // NOLINTBEGIN
141 MCNAPI static void** $vftable();
142 // NOLINTEND
143 };
144
145 using StructureProcessorList =
146 ::std::vector<::gsl::not_null<::std::shared_ptr<::br::worldgen::StructureProcessor const>>>;
147
148 using StructureProcessorPtr = ::gsl::not_null<::std::shared_ptr<::br::worldgen::StructureProcessor const>>;
149
150public:
151 // member variables
152 // NOLINTBEGIN
153 ::ll::TypedStorage<8, 16, ::std::shared_ptr<::SharedTypes::v1_21_80::JigsawStructureMetadata>> mMetadata;
154 ::ll::TypedStorage<8, 80, ::Bedrock::Threading::Mutex> mMetadataMutex;
155 ::ll::TypedStorage<4, 4, ::brstd::once_flag> mTemplateOnceFlag;
156 ::ll::TypedStorage<8, 56, ::std::optional<::StructurePoolElement::LazyTemplate>> mTemplate;
157 ::ll::TypedStorage<8, 8, uint64> mMetadataKey;
158 ::ll::TypedStorage<8, 32, ::std::string> mLocation;
159 ::ll::TypedStorage<8, 24, ::Bedrock::NotNullNonOwnerPtr<::IStructureTemplateManager>> mManager;
160 ::ll::TypedStorage<8, 32, ::StructurePoolElementSettings> mSettings;
161 ::ll::TypedStorage<
162 8,
163 16,
164 ::gsl::not_null<::std::shared_ptr<
165 ::std::vector<::gsl::not_null<::std::shared_ptr<::br::worldgen::StructureProcessor const>>> const>>>
166 mProcessors;
167 ::ll::TypedStorage<1, 1, bool> mValid;
168 // NOLINTEND
169
170public:
171 // prevent constructor by default
172 StructurePoolElement();
173
174public:
175 // virtual functions
176 // NOLINTBEGIN
177 virtual ::BlockPos getSize(::Rotation rotation) const;
178
179 virtual ::std::vector<::JigsawBlockInfo> getJigsawMarkers(::BlockPos position, ::Rotation rotation) const;
180
181 virtual ::std::vector<::JigsawBlockInfo>
182 getJigsawMarkers(::BlockPos position, ::LegacyStructureSettings& settings, ::BlockSource* region) const;
183
184 virtual ::BoundingBox getBoundingBox(::BlockPos position, ::Rotation rotation) const;
185
186 virtual void setProjection(::Projection projection);
187
188 virtual ::Projection getProjection() const;
189
190 virtual ::PostProcessSettings getPostProcessSettings() const;
191
192 virtual bool place(
193 ::BlockSource& region,
194 ::BlockPos position,
195 ::Rotation rotation,
196 ::BoundingBox chunkBB,
197 ::Random& random,
198 ::std::unordered_map<::BlockPos, ::std::optional<::ActorDefinitionIdentifier>>& entitiesToPlace,
199 ::BlockPos refPos
200 ) const;
201
202 virtual bool place(
203 ::BlockSource& region,
204 ::BlockPos position,
205 ::BlockPos sectionOrigin,
206 ::BoundingBox chunkBB,
207 ::Rotation rotation,
208 ::IRandom& random,
209 ::br::worldgen::JigsawReplacement jigsaw,
210 ::br::worldgen::LiquidSettings liquidSettings
211 ) const;
212
213 virtual void placeActors(::BlockSource& region, ::BlockPos position, ::Rotation rotation, ::Random& random) const;
214
215 virtual void
216 placeEntities(::BlockSource& region, ::BlockPos position, ::Rotation rotation, ::BoundingBox overlapBB) const;
217
218 virtual void
219 handleJigsawBlock(::BlockSource& region, ::JigsawBlockInfo& jigsawBlock, ::LegacyStructureSettings& settings) const;
220
221 virtual void handleDataMarker(
222 ::BlockSource& region,
223 ::BlockPos markerPos,
224 ::std::string markerData,
225 ::std::unordered_map<::BlockPos, ::std::optional<::ActorDefinitionIdentifier>>& entitiesToPlace
226 ) const;
227
228 virtual bool isValid() const;
229
230 virtual ~StructurePoolElement();
231
232 virtual ::StructurePoolElementType type() const;
233
234 virtual ::std::shared_ptr<::SharedTypes::v1_21_80::JigsawStructureMetadata> createMetadata() const;
235 // NOLINTEND
236
237public:
238 // member functions
239 // NOLINTBEGIN
240 MCAPI StructurePoolElement(
241 ::Bedrock::NotNullNonOwnerPtr<::IStructureTemplateManager> manager,
242 ::std::string const& location,
244 );
245
246 MCAPI StructurePoolElement(
247 ::Bedrock::NotNullNonOwnerPtr<::IStructureTemplateManager> manager,
248 ::std::string const& location,
249 ::gsl::not_null<::std::shared_ptr<
250 ::std::vector<::gsl::not_null<::std::shared_ptr<::br::worldgen::StructureProcessor const>>> const>>
251 processors,
252 ::Projection projection
253 );
254
255 MCAPI StructurePoolElement(
256 ::Bedrock::NotNullNonOwnerPtr<::IStructureTemplateManager> manager,
257 ::std::string const& location,
258 ::Projection projection,
259 ::PostProcessSettings postProcessSettings
260 );
261
262 MCAPI StructurePoolElement(
263 ::Bedrock::NotNullNonOwnerPtr<::IStructureTemplateManager> manager,
264 ::std::string const& location,
265 ::std::vector<::std::unique_ptr<::StructurePoolBlockRule>> const* blockRules,
266 ::std::vector<::std::unique_ptr<::StructurePoolBlockTagRule>> const* blockTagRules,
267 ::std::vector<::std::unique_ptr<::StructurePoolActorRule>> const* actorRules,
268 ::Projection projection,
269 ::PostProcessSettings postProcessSettings
270 );
271
272 MCAPI ::SharedTypes::v1_21_80::JigsawStructureMetadata const& _getMetadata() const;
273
274 MCAPI uint64 _getMetadataKey() const;
275
276 MCFOLD ::std::string const& getLocation() const;
277
278 MCAPI ::SharedTypes::v1_21_80::JigsawStructureMetadata const& getMetadata() const;
279
280 MCFOLD uint64 getMetadataKey() const;
281
282 MCAPI bool operator!=(::StructurePoolElement const& rhs) const;
283 // NOLINTEND
284
285public:
286 // static functions
287 // NOLINTBEGIN
288 MCAPI static ::std::function<::StructurePoolElement const&(::StructureTemplateRegistrationContext, ::Projection)>
289 empty();
290
291 MCAPI static ::std::function<::StructurePoolElement const&(::StructureTemplateRegistrationContext, ::Projection)>
292 single(::std::string_view location);
293
294 MCAPI static ::std::function<::StructurePoolElement const&(::StructureTemplateRegistrationContext, ::Projection)>
295 single(
296 ::std::string_view location,
297 ::gsl::not_null<::std::shared_ptr<
298 ::std::vector<::gsl::not_null<::std::shared_ptr<::br::worldgen::StructureProcessor const>>> const>>
299 processors
300 );
301
302 MCAPI static ::std::function<::StructurePoolElement const&(::StructureTemplateRegistrationContext, ::Projection)>
303 single(
304 ::std::string_view location,
305 ::std::vector<::std::unique_ptr<::StructurePoolBlockRule>> const* blockRules,
306 ::std::vector<::std::unique_ptr<::StructurePoolBlockTagRule>> const* blockTagRules,
307 ::std::vector<::std::unique_ptr<::StructurePoolActorRule>> const* actorRules
308 );
309 // NOLINTEND
310
311public:
312 // constructor thunks
313 // NOLINTBEGIN
314 MCAPI void* $ctor(
315 ::Bedrock::NotNullNonOwnerPtr<::IStructureTemplateManager> manager,
316 ::std::string const& location,
318 );
319
320 MCAPI void* $ctor(
321 ::Bedrock::NotNullNonOwnerPtr<::IStructureTemplateManager> manager,
322 ::std::string const& location,
323 ::gsl::not_null<::std::shared_ptr<
324 ::std::vector<::gsl::not_null<::std::shared_ptr<::br::worldgen::StructureProcessor const>>> const>>
325 processors,
326 ::Projection projection
327 );
328
329 MCAPI void* $ctor(
330 ::Bedrock::NotNullNonOwnerPtr<::IStructureTemplateManager> manager,
331 ::std::string const& location,
332 ::Projection projection,
333 ::PostProcessSettings postProcessSettings
334 );
335
336 MCAPI void* $ctor(
337 ::Bedrock::NotNullNonOwnerPtr<::IStructureTemplateManager> manager,
338 ::std::string const& location,
339 ::std::vector<::std::unique_ptr<::StructurePoolBlockRule>> const* blockRules,
340 ::std::vector<::std::unique_ptr<::StructurePoolBlockTagRule>> const* blockTagRules,
341 ::std::vector<::std::unique_ptr<::StructurePoolActorRule>> const* actorRules,
342 ::Projection projection,
343 ::PostProcessSettings postProcessSettings
344 );
345 // NOLINTEND
346
347public:
348 // destructor thunk
349 // NOLINTBEGIN
350 MCAPI void $dtor();
351 // NOLINTEND
352
353public:
354 // virtual function thunks
355 // NOLINTBEGIN
356 MCAPI ::BlockPos $getSize(::Rotation rotation) const;
357
358 MCAPI ::std::vector<::JigsawBlockInfo> $getJigsawMarkers(::BlockPos position, ::Rotation rotation) const;
359
360 MCAPI ::std::vector<::JigsawBlockInfo>
361 $getJigsawMarkers(::BlockPos position, ::LegacyStructureSettings& settings, ::BlockSource* region) const;
362
363 MCAPI ::BoundingBox $getBoundingBox(::BlockPos position, ::Rotation rotation) const;
364
365 MCFOLD void $setProjection(::Projection projection);
366
367 MCFOLD ::Projection $getProjection() const;
368
369 MCFOLD ::PostProcessSettings $getPostProcessSettings() const;
370
371 MCAPI bool $place(
372 ::BlockSource& region,
373 ::BlockPos position,
374 ::Rotation rotation,
375 ::BoundingBox chunkBB,
376 ::Random& random,
377 ::std::unordered_map<::BlockPos, ::std::optional<::ActorDefinitionIdentifier>>& entitiesToPlace,
378 ::BlockPos refPos
379 ) const;
380
381 MCAPI bool $place(
382 ::BlockSource& region,
383 ::BlockPos position,
384 ::BlockPos sectionOrigin,
385 ::BoundingBox chunkBB,
386 ::Rotation rotation,
387 ::IRandom& random,
388 ::br::worldgen::JigsawReplacement jigsaw,
389 ::br::worldgen::LiquidSettings liquidSettings
390 ) const;
391
392 MCAPI void $placeActors(::BlockSource& region, ::BlockPos position, ::Rotation rotation, ::Random& random) const;
393
394 MCAPI void
395 $placeEntities(::BlockSource& region, ::BlockPos position, ::Rotation rotation, ::BoundingBox overlapBB) const;
396
397 MCAPI void $handleJigsawBlock(
398 ::BlockSource& region,
399 ::JigsawBlockInfo& jigsawBlock,
401 ) const;
402
403 MCAPI void $handleDataMarker(
404 ::BlockSource& region,
405 ::BlockPos markerPos,
406 ::std::string markerData,
407 ::std::unordered_map<::BlockPos, ::std::optional<::ActorDefinitionIdentifier>>& entitiesToPlace
408 ) const;
409
410 MCAPI bool $isValid() const;
411
412 MCFOLD ::StructurePoolElementType $type() const;
413
414 MCAPI ::std::shared_ptr<::SharedTypes::v1_21_80::JigsawStructureMetadata> $createMetadata() const;
415
416
417 // NOLINTEND
418
419public:
420 // vftables
421 // NOLINTBEGIN
422 MCNAPI static void** $vftable();
423 // NOLINTEND
424};
Definition BlockPos.h:21
Definition BlockSource.h:73
Definition BoundingBox.h:13
Definition IRandom.h:10
Definition IStructureTemplateManager.h:16
Definition JigsawBlockInfo.h:14
Definition JigsawStructureBlockInfo.h:14
Definition LegacyStructureSettings.h:22
Definition LegacyStructureTemplate.h:27
Definition Random.h:10
Definition StructurePoolActorRule.h:10
Definition StructurePoolBlockRule.h:16
Definition StructurePoolBlockTagRule.h:13
Definition StructurePoolElement.h:49
Definition StructurePoolElement.h:69
static MCAPI void ** $vftable()
static MCAPI void ** $vftable()
Definition StructureTemplate.h:35
Definition ActorDefinitionIdentifier.h:15
Definition JigsawStructureMetadata.h:16
Definition StructurePoolElementSettings.h:16
Definition StructureTemplateRegistrationContext.h:17
Definition StructureProcessor.h:23