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