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