LeviLamina
Loading...
Searching...
No Matches
ItemDescriptor.h
1#pragma once
2
3#include "mc/_HeaderOutputPredefine.h"
4
5// auto generated inclusion list
6#include "mc/common/WeakPtr.h"
7#include "mc/molang/MolangVersion.h"
8
9// auto generated forward declare list
10// clang-format off
11class BinaryStream;
12class Block;
13class BlockLegacy;
14class CompoundTag;
15class Item;
17struct ItemTag;
18namespace Json { class Value; }
19namespace SharedTypes::Legacy { struct ItemDescriptor; }
20// clang-format on
21
23public:
24 // ItemDescriptor inner types declare
25 // clang-format off
26 struct BaseDescriptor;
27 struct ItemEntry;
28 // clang-format on
29
30 // ItemDescriptor inner types define
31 struct ItemEntry {
32 public:
33 // member variables
34 // NOLINTBEGIN
35 ::ll::TypedStorage<8, 8, ::Item const*> mItem;
36 ::ll::TypedStorage<2, 2, short> mAuxValue;
37 // NOLINTEND
38
39 public:
40 // member functions
41 // NOLINTBEGIN
42 MCNAPI ::Block const* getBlock() const;
43 // NOLINTEND
44 };
45
46 enum class InternalType : uchar {
47 Invalid = 0,
48 Default = 1,
49 Molang = 2,
50 ItemTag = 3,
51 Deferred = 4,
52 ComplexAlias = 5,
53 };
54
56 public:
57 // virtual functions
58 // NOLINTBEGIN
59 // vIndex: 0
60 virtual ::std::unique_ptr<::ItemDescriptor::BaseDescriptor> clone() const = 0;
61
62 // vIndex: 1
63 virtual bool sameItems(::ItemDescriptor::BaseDescriptor const& otherDescriptor, bool compareAux) const;
64
65 // vIndex: 2
66 virtual bool sameItem(::ItemDescriptor::ItemEntry const&, bool) const = 0;
67
68 // vIndex: 3
69 virtual ::std::string getFullName() const;
70
71 // vIndex: 4
72 virtual ::std::string toString() const;
73
74 // vIndex: 5
75 virtual ::ItemDescriptor::ItemEntry getItem() const;
76
77 // vIndex: 6
78 virtual bool forEachItemUntil(::std::function<bool(::Item const&, short)> func) const;
79
80 // vIndex: 7
81 virtual ::std::map<::std::string, ::std::string> toMap() const = 0;
82
83 // vIndex: 8
84 virtual ::std::optional<::CompoundTag> save() const = 0;
85
86 // vIndex: 10
87 virtual void serialize(::Json::Value& val) const;
88
89 // vIndex: 9
90 virtual void serialize(::BinaryStream&) const = 0;
91
92 // vIndex: 11
93 virtual ::ItemDescriptor::InternalType getType() const = 0;
94
95 // vIndex: 12
96 virtual bool isValid() const;
97
98 // vIndex: 13
99 virtual uint64 getHash() const = 0;
100
101 // vIndex: 14
102 virtual bool shouldResolve() const;
103
104 // vIndex: 15
105 virtual ::std::unique_ptr<::ItemDescriptor::BaseDescriptor> resolve() const;
106
107 // vIndex: 16
108 virtual ~BaseDescriptor();
109 // NOLINTEND
110
111 public:
112 // destructor thunk
113 // NOLINTBEGIN
114 MCNAPI void $dtor();
115 // NOLINTEND
116
117 public:
118 // virtual function thunks
119 // NOLINTBEGIN
120 MCNAPI bool $sameItems(::ItemDescriptor::BaseDescriptor const& otherDescriptor, bool compareAux) const;
121
122 MCNAPI ::std::string $getFullName() const;
123
124 MCNAPI ::std::string $toString() const;
125
126 MCNAPI ::ItemDescriptor::ItemEntry $getItem() const;
127
128 MCNAPI bool $forEachItemUntil(::std::function<bool(::Item const&, short)> func) const;
129
130 MCNAPI void $serialize(::Json::Value& val) const;
131
132 MCNAPI bool $isValid() const;
133
134 MCNAPI bool $shouldResolve() const;
135
136 MCNAPI ::std::unique_ptr<::ItemDescriptor::BaseDescriptor> $resolve() const;
137 // NOLINTEND
138
139 public:
140 // vftables
141 // NOLINTBEGIN
142 MCNAPI static void** $vftable();
143 // NOLINTEND
144 };
145
146public:
147 // member variables
148 // NOLINTBEGIN
149 ::ll::TypedStorage<8, 8, ::std::unique_ptr<::ItemDescriptor::BaseDescriptor>> mImpl;
150 // NOLINTEND
151
152public:
153 // prevent constructor by default
156
157public:
158 // virtual functions
159 // NOLINTBEGIN
160 // vIndex: 0
161 virtual ~ItemDescriptor();
162
163 // vIndex: 2
164 virtual void serialize(::Json::Value& val) const;
165
166 // vIndex: 1
167 virtual void serialize(::BinaryStream& stream) const;
168 // NOLINTEND
169
170public:
171 // member functions
172 // NOLINTBEGIN
173 MCAPI explicit ItemDescriptor(::Block const& block);
174
175 MCAPI explicit ItemDescriptor(::BlockLegacy const& block);
176
177 MCAPI explicit ItemDescriptor(::ItemTag const& itemTag);
178
179 MCAPI explicit ItemDescriptor(::ReadOnlyBinaryStream& stream);
180
181 MCAPI ItemDescriptor(::std::string_view fullName, int itemAux);
182
183 MCAPI ItemDescriptor(::Item const& item, int auxValue);
184
185 MCAPI ItemDescriptor(::Json::Value const& val, ::MolangVersion molangVersion);
186
187 MCAPI void _resolve() const;
188
189 MCAPI bool forEachItemUntil(::std::function<bool(::Item const&, short)> func) const;
190
191 MCAPI short getAuxValue() const;
192
193 MCAPI ::Block const* getBlock() const;
194
195 MCAPI ::std::string getFullName() const;
196
197 MCAPI short getId() const;
198
199 MCAPI int getIdAux() const;
200
201 MCAPI ::Item const* getItem() const;
202
203 MCAPI ::WeakPtr<::BlockLegacy const> const& getLegacyBlock() const;
204
205 MCAPI ::std::string getRawNameId() const;
206
207 MCAPI ::std::string getSerializedNameAndAux() const;
208
209 MCAPI bool isNull() const;
210
211 MCAPI bool isValid(bool shouldResolve) const;
212
213 MCAPI void operator=(::ItemDescriptor const& rhs);
214
215 MCAPI void operator=(::ItemDescriptor&& rhs);
216
217 MCAPI bool sameItem(::ItemDescriptor const& otherItemDescriptor, bool compareAux) const;
218
219 MCAPI ::std::optional<::CompoundTag> save() const;
220 // NOLINTEND
221
222public:
223 // static functions
224 // NOLINTBEGIN
225 MCAPI static ::std::optional<::ItemDescriptor> fromTag(::CompoundTag const* tag);
226
227 MCAPI static ::SharedTypes::Legacy::ItemDescriptor toSharedTypes(::ItemDescriptor const& id);
228 // NOLINTEND
229
230public:
231 // constructor thunks
232 // NOLINTBEGIN
233 MCAPI void* $ctor(::Block const& block);
234
235 MCAPI void* $ctor(::BlockLegacy const& block);
236
237 MCAPI void* $ctor(::ItemTag const& itemTag);
238
239 MCAPI void* $ctor(::ReadOnlyBinaryStream& stream);
240
241 MCAPI void* $ctor(::std::string_view fullName, int itemAux);
242
243 MCAPI void* $ctor(::Item const& item, int auxValue);
244
245 MCAPI void* $ctor(::Json::Value const& val, ::MolangVersion molangVersion);
246 // NOLINTEND
247
248public:
249 // destructor thunk
250 // NOLINTBEGIN
251 MCFOLD void $dtor();
252 // NOLINTEND
253
254public:
255 // virtual function thunks
256 // NOLINTBEGIN
257 MCAPI void $serialize(::Json::Value& val) const;
258
259 MCAPI void $serialize(::BinaryStream& stream) const;
260 // NOLINTEND
261
262public:
263 // vftables
264 // NOLINTBEGIN
265 MCNAPI static void** $vftable();
266 // NOLINTEND
267};
Definition BinaryStream.h:10
Definition BlockLegacy.h:88
Definition Block.h:38
Definition CompoundTag.h:13
Definition ItemDescriptor.h:22
static MCAPI void ** $vftable()
Definition Item.h:65
Definition Value.h:16
Definition ReadOnlyBinaryStream.h:8
Definition ItemDescriptor.h:55
MCAPI bool $sameItems(::ItemDescriptor::BaseDescriptor const &otherDescriptor, bool compareAux) const
MCAPI bool $isValid() const
MCAPI::ItemDescriptor::ItemEntry $getItem() const
MCAPI ::std::unique_ptr<::ItemDescriptor::BaseDescriptor > $resolve() const
MCAPI::std::string $getFullName() const
MCAPI bool $shouldResolve() const
MCAPI::std::string $toString() const
MCAPI void $serialize(::Json::Value &val) const
MCAPI bool $forEachItemUntil(::std::function< bool(::Item const &, short)> func) const
static MCAPI void ** $vftable()
Definition ItemDescriptor.h:31
MCAPI::Block const * getBlock() const
Definition ItemTag.h:8
Definition serialize.h:11