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