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 char filler[0xB8];
24
25public:
26 // BlockDescriptor inner types declare
27 // clang-format off
28 class ResolveHelper;
29 class ResolvedState;
30 struct State;
31 // clang-format on
32
33 // BlockDescriptor inner types define
34 enum class CompareType : int {
35 AnyTag = 0,
36 BlockName = 1,
37 States = 2,
38 Unknown = 3,
39 };
40
41 class ResolveHelper {
42 public:
43 // member variables
44 // NOLINTBEGIN
45 ::ll::TypedStorage<8, 8, ::BlockDescriptor&> mBlockDescriptor;
46 // NOLINTEND
47
48 public:
49 // prevent constructor by default
50 ResolveHelper& operator=(ResolveHelper const&);
51 ResolveHelper(ResolveHelper const&);
52 ResolveHelper();
53
54 public:
55 // member functions
56 // NOLINTBEGIN
57 MCAPI void resolve(bool logInvalidBlocks);
58 // NOLINTEND
59 };
60
62 public:
63 // member variables
64 // NOLINTBEGIN
65 ::ll::TypedStorage<8, 8, ::gsl::not_null<::BlockState const*>> mBlockState;
66 ::ll::TypedStorage<4, 4, int> mValue;
67 // NOLINTEND
68 };
69
70 struct State {
71 public:
72 // member variables
73 // NOLINTBEGIN
74 ::ll::TypedStorage<8, 48, ::HashedString> mName;
75 ::ll::TypedStorage<8, 40, ::SharedTypes::Legacy::BlockDescriptor::Compound> mState;
76 // NOLINTEND
77
78 public:
79 // prevent constructor by default
80 State();
81
82 public:
83 // member functions
84 // NOLINTBEGIN
85 MCAPI State(::HashedString name, int intState);
86
88
89 MCAPI State(::HashedString name, ::std::string const& stringState);
90
91 MCAPI ~State();
92 // NOLINTEND
93
94 public:
95 // constructor thunks
96 // NOLINTBEGIN
97 MCAPI void* $ctor(::HashedString name, int intState);
98
100
101 MCAPI void* $ctor(::HashedString name, ::std::string const& stringState);
102 // NOLINTEND
103
104 public:
105 // destructor thunk
106 // NOLINTBEGIN
107 MCFOLD void $dtor();
108 // NOLINTEND
109 };
110
112
113public:
114 // member variables
115 // NOLINTBEGIN
116 ::ll::TypedStorage<8, 8, ::BlockDescriptor::ResolveHelper> mResolveHelper;
117 ::ll::TypedStorage<8, 48, ::HashedString> mBlockName;
118 ::ll::TypedStorage<1, 1, bool> mIsComplexAlias;
119 ::ll::TypedStorage<8, 16, ::std::shared_ptr<::ExpressionNode>> mTags;
120 ::ll::TypedStorage<8, 24, ::std::vector<::BlockDescriptor::State>> mRawStates;
121 ::ll::TypedStorage<8, 24, ::std::vector<::BlockDescriptor::ResolvedState>> mResolvedStates;
122 ::ll::TypedStorage<4, 4, ::BlockDescriptor::CompareType> mCompareType;
123 ::ll::TypedStorage<1, 1, bool> mContentLogOnError;
124 ::ll::TypedStorage<8, 8, ::Block const*> mBlock;
125 ::ll::TypedStorage<1, 1, bool> mValid;
126 ::ll::TypedStorage<1, 1, bool> mIsDeferred;
127 ::ll::TypedStorage<8, 24, ::SpinLockImpl> mLock;
128 // NOLINTEND
129
130public:
131 // member functions
132 // NOLINTBEGIN
133 MCAPI BlockDescriptor();
134
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 MCFOLD ::std::vector<::BlockDescriptor::State> const& getStates() const;
156
157 MCAPI ::std::string getTagExpression() const;
158
159 MCAPI bool isValid() const;
160
161 MCAPI bool matches(::Block const& block) const;
162
163 MCAPI bool matches(::BlockDescriptor const& otherDescriptor) const;
164
165 MCAPI void operator=(::BlockDescriptor&& rhs);
166
167 MCAPI void operator=(::BlockDescriptor const& rhs);
168
169 MCAPI bool operator==(::BlockDescriptor const& rhs) const;
170
171 MCFOLD void setContentLogOnError(bool value) const;
172
173 MCAPI ::std::unique_ptr<::CompoundTag> toCompoundTag() const;
174
175 MCAPI ::Block const* tryGetBlock() const;
176
177 MCAPI ::Block const* tryGetBlockNoLogging() const;
178
179 MCAPI ~BlockDescriptor();
180 // NOLINTEND
181
182public:
183 // static functions
184 // NOLINTBEGIN
185 MCAPI static bool anyMatch(::std::vector<::BlockDescriptor> const& blockDescriptors, ::Block const& block);
186
187 MCAPI static bool
188 anyMatch(::std::vector<::BlockDescriptor> const& blockDescriptors, ::BlockDescriptor const& otherBlockDescriptor);
189
190 MCAPI static void bindType(::cereal::ReflectionCtx& ctx);
191
192 MCAPI static ::BlockDescriptor fromCompoundTag(::CompoundTag const& tag);
193
194 MCAPI static ::BlockDescriptor fromTagExpression(::std::string const& tagExpression, ::MolangVersion molangVersion);
195
196 MCAPI static ::SharedTypes::Legacy::BlockDescriptor toSharedTypes(::BlockDescriptor const& instance);
197 // NOLINTEND
198
199public:
200 // static variables
201 // NOLINTBEGIN
202 MCAPI static ::std::add_lvalue_reference_t<char const[]> JSON_NAME_FIELD();
203
204 MCAPI static ::std::add_lvalue_reference_t<char const[]> JSON_STATES_FIELD();
205
206 MCAPI static ::std::add_lvalue_reference_t<char const[]> JSON_TAGS_FIELD();
207 // NOLINTEND
208
209public:
210 // constructor thunks
211 // NOLINTBEGIN
212 MCAPI void* $ctor();
213
214 MCAPI void* $ctor(::SharedTypes::Legacy::BlockDescriptor desc);
215
216 MCAPI void* $ctor(::HashedString const& fullName);
217
218 MCAPI void* $ctor(::BlockDescriptor&& rhs);
219
220 MCAPI void* $ctor(::BlockDescriptor const& rhs);
221
222 MCAPI void* $ctor(::std::string const& name, ::std::vector<::BlockDescriptor::State>&& states);
223 // NOLINTEND
224
225public:
226 // destructor thunk
227 // NOLINTBEGIN
228 MCAPI void $dtor();
229 // NOLINTEND
230};
Definition BlockDescriptor.h:41
Definition BlockDescriptor.h:61
Definition BlockState.h:14
Definition Block.h:69
Definition CompoundTag.h:23
Definition ExpressionNode.h:35
Definition HashedString.h:5
Definition BlockDescriptor.h:70
Definition BlockDescriptor.h:20
Definition BlockDescriptor.h:12
Definition ReflectionCtx.h:11
Definition ctx.h:5