LeviLamina
Loading...
Searching...
No Matches
BlockDescriptor.h
1#pragma once
2
3#include "mc/_HeaderOutputPredefine.h"
4
5// auto generated inclusion list
6#include "mc/deps/core/string/HashedString.h"
7#include "mc/deps/shared_types/legacy/BlockDescriptor.h"
8#include "mc/molang/MolangVersion.h"
9#include "mc/platform/threading/SpinLockImpl.h"
10
11// auto generated forward declare list
12// clang-format off
13class Block;
14class BlockState;
15class CompoundTag;
16class ExpressionNode;
17namespace SharedTypes::Legacy { struct BlockDescriptor; }
18namespace cereal { struct ReflectionCtx; }
19// clang-format on
20
21class BlockDescriptor {
22public:
23 // BlockDescriptor inner types declare
24 // clang-format off
25 class ResolveHelper;
26 class ResolvedState;
27 struct State;
28 // clang-format on
29
30 // BlockDescriptor inner types define
31 enum class CompareType : int {
32 AnyTag = 0,
33 BlockName = 1,
34 States = 2,
35 Unknown = 3,
36 };
37
38 class ResolveHelper {
39 public:
40 // member variables
41 // NOLINTBEGIN
42 ::ll::TypedStorage<8, 8, ::BlockDescriptor&> mBlockDescriptor;
43 // NOLINTEND
44
45 public:
46 // prevent constructor by default
47 ResolveHelper& operator=(ResolveHelper const&);
48 ResolveHelper(ResolveHelper const&);
49 ResolveHelper();
50
51 public:
52 // member functions
53 // NOLINTBEGIN
54 MCAPI void resolve(bool logInvalidBlocks);
55 // NOLINTEND
56 };
57
59 public:
60 // member variables
61 // NOLINTBEGIN
62 ::ll::TypedStorage<8, 8, ::gsl::not_null<::BlockState const*>> mBlockState;
63 ::ll::TypedStorage<4, 4, int> mValue;
64 // NOLINTEND
65 };
66
67 struct State {
68 public:
69 // member variables
70 // NOLINTBEGIN
71 ::ll::TypedStorage<8, 48, ::HashedString> mName;
72 ::ll::TypedStorage<8, 40, ::SharedTypes::Legacy::BlockDescriptor::Compound> mState;
73 // NOLINTEND
74
75 public:
76 // prevent constructor by default
77 State();
78
79 public:
80 // member functions
81 // NOLINTBEGIN
83
84 MCAPI State(::HashedString name, ::std::string const& stringState);
85
86 MCAPI ~State();
87 // NOLINTEND
88
89 public:
90 // constructor thunks
91 // NOLINTBEGIN
93
94 MCAPI void* $ctor(::HashedString name, ::std::string const& stringState);
95 // NOLINTEND
96
97 public:
98 // destructor thunk
99 // NOLINTBEGIN
100 MCFOLD void $dtor();
101 // NOLINTEND
102 };
103
105
106public:
107 // member variables
108 // NOLINTBEGIN
109 ::ll::TypedStorage<8, 8, ::BlockDescriptor::ResolveHelper> mResolveHelper;
110 ::ll::TypedStorage<8, 48, ::HashedString> mBlockName;
111 ::ll::TypedStorage<1, 1, bool> mIsComplexAlias;
112 ::ll::TypedStorage<8, 16, ::std::shared_ptr<::ExpressionNode>> mTags;
113 ::ll::TypedStorage<8, 24, ::std::vector<::BlockDescriptor::State>> mRawStates;
114 ::ll::TypedStorage<8, 24, ::std::vector<::BlockDescriptor::ResolvedState>> mResolvedStates;
115 ::ll::TypedStorage<4, 4, ::BlockDescriptor::CompareType> mCompareType;
116 ::ll::TypedStorage<1, 1, bool> mContentLogOnError;
117 ::ll::TypedStorage<8, 8, ::Block const*> mBlock;
118 ::ll::TypedStorage<1, 1, bool> mValid;
119 ::ll::TypedStorage<1, 1, bool> mIsDeferred;
120 ::ll::TypedStorage<8, 24, ::SpinLockImpl> mLock;
121 // NOLINTEND
122
123public:
124 static bool anyMatch(::std::vector<::BlockDescriptor> const& blockDescriptors, ::Block const& block) {
125 return std::ranges::any_of(blockDescriptors, [&block](auto&& des) { return des.matches(block); });
126 }
127
128public:
129 // prevent constructor by default
130 BlockDescriptor();
131
132public:
133 // member functions
134 // NOLINTBEGIN
135 MCAPI explicit BlockDescriptor(::SharedTypes::Legacy::BlockDescriptor desc);
136
137 MCAPI explicit BlockDescriptor(::HashedString const& fullName);
138
139 MCAPI BlockDescriptor(::BlockDescriptor&& rhs);
140
141 MCAPI BlockDescriptor(::BlockDescriptor const& rhs);
142
143 MCAPI BlockDescriptor(::std::string const& name, ::std::vector<::BlockDescriptor::State>&& states);
144
145 MCAPI bool _anyTagsMatch(::Block const& block) const;
146
147 MCAPI bool _statesMatch(::Block const& block) const;
148
149 MCAPI ::Block const& getBlockOrUnknownBlock() const;
150
151 MCAPI ::BlockDescriptor::CompareType const& getCompareType() const;
152
153 MCAPI ::std::string const& getFullName() const;
154
155 MCAPI bool isValid() const;
156
157 MCAPI bool matches(::Block const& block) const;
158
159 MCAPI bool matches(::BlockDescriptor const& otherDescriptor) const;
160
161 MCAPI void operator=(::BlockDescriptor&& rhs);
162
163 MCAPI void operator=(::BlockDescriptor const& rhs);
164
165 MCAPI ::std::unique_ptr<::CompoundTag> toCompoundTag() const;
166
167 MCAPI ::Block const* tryGetBlock() const;
168
169 MCAPI ::Block const* tryGetBlockNoLogging() const;
170
171 MCAPI ~BlockDescriptor();
172 // NOLINTEND
173
174public:
175 // static functions
176 // NOLINTBEGIN
177 MCAPI static void bindType(::cereal::ReflectionCtx& ctx);
178
179 MCAPI static ::BlockDescriptor fromCompoundTag(::CompoundTag const& tag);
180
181 MCAPI static ::BlockDescriptor fromTagExpression(::std::string const& tagExpression, ::MolangVersion molangVersion);
182
183 MCAPI static ::SharedTypes::Legacy::BlockDescriptor toSharedTypes(::BlockDescriptor const& instance);
184 // NOLINTEND
185
186public:
187 // static variables
188 // NOLINTBEGIN
189 MCAPI static ::std::add_lvalue_reference_t<char const[]> JSON_NAME_FIELD();
190
191 MCAPI static ::std::add_lvalue_reference_t<char const[]> JSON_STATES_FIELD();
192
193 MCAPI static ::std::add_lvalue_reference_t<char const[]> JSON_TAGS_FIELD();
194 // NOLINTEND
195
196public:
197 // constructor thunks
198 // NOLINTBEGIN
199 MCAPI void* $ctor(::SharedTypes::Legacy::BlockDescriptor desc);
200
201 MCAPI void* $ctor(::HashedString const& fullName);
202
203 MCAPI void* $ctor(::BlockDescriptor&& rhs);
204
205 MCAPI void* $ctor(::BlockDescriptor const& rhs);
206
207 MCAPI void* $ctor(::std::string const& name, ::std::vector<::BlockDescriptor::State>&& states);
208 // NOLINTEND
209
210public:
211 // destructor thunk
212 // NOLINTBEGIN
213 MCAPI void $dtor();
214 // NOLINTEND
215};
Definition BlockDescriptor.h:38
Definition BlockDescriptor.h:58
Definition BlockState.h:14
Definition Block.h:41
Definition CompoundTag.h:18
Definition ExpressionNode.h:35
Definition HashedString.h:5
Definition BlockDescriptor.h:67
Definition BlockDescriptor.h:20
Definition BlockDescriptor.h:12
Definition ReflectionCtx.h:11