LeviLamina
Loading...
Searching...
No Matches
StructureCache.h
1#pragma once
2
3#include "mc/_HeaderOutputPredefine.h"
4
5// auto generated inclusion list
6#include "mc/world/level/ChunkPos.h"
7
8// auto generated forward declare list
9// clang-format off
10class BlockPos;
11namespace br::worldgen { class StructureInstance; }
12namespace br::worldgen { struct Structure; }
13// clang-format on
14
15namespace br::worldgen {
16
18public:
19 // StructureCache inner types declare
20 // clang-format off
21 struct StructurePair;
22 struct StructureTempOwner;
23 // clang-format on
24
25 // StructureCache inner types define
27 public:
28 // member variables
29 // NOLINTBEGIN
30 ::ll::TypedStorage<8, 8, uint64> mStructure;
31 ::ll::TypedStorage<8, 16, ::std::weak_ptr<::br::worldgen::StructureInstance>> mInstance;
32 // NOLINTEND
33 };
34
36 public:
37 // member variables
38 // NOLINTBEGIN
39 ::ll::TypedStorage<8, 24, ::std::vector<int>> mTimers;
40 ::ll::TypedStorage<8, 24, ::std::vector<::std::shared_ptr<::br::worldgen::StructureInstance>>> mInstances;
41 ::ll::TypedStorage<8, 8, ::std::shared_mutex> mMutex;
42 // NOLINTEND
43 };
44
45 using StructureMap = ::std::unordered_map<::ChunkPos, ::std::vector<::br::worldgen::StructureCache::StructurePair>>;
46
47public:
48 // member variables
49 // NOLINTBEGIN
50 ::ll::TypedStorage<
51 8,
52 64,
53 ::std::unordered_map<::ChunkPos, ::std::vector<::br::worldgen::StructureCache::StructurePair>>>
54 mCache;
55 ::ll::TypedStorage<8, 8, ::std::shared_mutex> mCacheMutex;
56 ::ll::TypedStorage<8, 56, ::br::worldgen::StructureCache::StructureTempOwner> mWaitingToBeClaimed;
57 ::ll::TypedStorage<4, 4, int> mGcTimer;
58 // NOLINTEND
59
60public:
61 // member functions
62 // NOLINTBEGIN
63 MCAPI ::std::shared_ptr<::br::worldgen::StructureInstance const> at(::BlockPos pos) const;
64
65 MCAPI ::std::vector<::std::vector<::std::shared_ptr<::br::worldgen::StructureInstance const>>>
66 collectGroupByStep() const;
67
68 MCAPI bool setInstanceForStructure(
69 ::br::worldgen::Structure const& structure,
70 ::std::shared_ptr<::br::worldgen::StructureInstance>&& instance,
71 ::ChunkPos chunkPos
72 );
73
74 MCAPI void tick();
75 // NOLINTEND
76};
77
78} // namespace br::worldgen
Definition BlockPos.h:17
Definition ChunkPos.h:13
Definition StructureCache.h:17
Definition StructureInstance.h:20
Definition StructureCache.h:26
Definition Structure.h:23