LeviLamina
Loading...
Searching...
No Matches
ListTag.h
1#pragma once
2
3#include "mc/_HeaderOutputPredefine.h"
4#include "mc/deps/nbt/UniqueTagPtr.h"
5
6// auto generated inclusion list
7#include "mc/deps/nbt/Tag.h"
8#include "mc/platform/Result.h"
9#include "mc/platform/brstd/function_ref.h"
10
11// auto generated forward declare list
12// clang-format off
13class CompoundTag;
14class IDataInput;
15class IDataOutput;
16class PrintStream;
17// clang-format on
18
20
21class ListTag : public ::Tag, public std::vector<UniqueTagPtr> {
22public:
23 using List = std::vector<UniqueTagPtr>;
24 Tag::Type mType{Tag::End};
25
26 using Tag::operator==;
27
28public:
29 [[nodiscard]] constexpr ListTag() = default;
30
31 [[nodiscard]] constexpr ListTag(List tags) : List(std::move(tags)) {
32 if (!empty()) mType = front().getId();
33 }
34 [[nodiscard]] constexpr ListTag(std::initializer_list<CompoundTagVariant> tags);
35 [[nodiscard]] constexpr ListTag(std::vector<CompoundTagVariant> tags);
36
37public:
38 // virtual functions
39 // NOLINTBEGIN
40 virtual void write(::IDataOutput& dos) const /*override*/;
41
42 virtual ::Bedrock::Result<void> load(::IDataInput& dis) /*override*/;
43
44 virtual ::Tag::Type getId() const /*override*/;
45
46 virtual ::std::string toString() const /*override*/;
47
48 virtual void print(::std::string const& prefix_, ::PrintStream& out) const /*override*/;
49
50 virtual ::std::unique_ptr<::Tag> copy() const /*override*/;
51
52 virtual uint64 hash() const /*override*/;
53
54 virtual bool equals(::Tag const& rhs) const /*override*/;
55
56 virtual void deleteChildren() /*override*/;
57 // NOLINTEND
58
59public:
60 // member functions
61 // NOLINTBEGIN
62 MCAPI void add(::std::unique_ptr<::Tag> tag);
63
64 MCAPI ::std::unique_ptr<::ListTag> copyList() const;
65
66 MCAPI void forEachCompoundTag(::brstd::function_ref<void(::CompoundTag const&)> func) const;
67
68 MCAPI void forEachTag(::brstd::function_ref<void(::Tag const&)> func) const;
69
70 MCAPI ::Tag* get(int index) const;
71
72 MCAPI uchar getByte(int index) const;
73
74 MCFOLD ::CompoundTag const* getCompound(uint64 index) const;
75
76 MCFOLD ::CompoundTag* getCompound(uint64 index);
77
78 MCAPI double getDouble(int index) const;
79
80 MCAPI float getFloat(int index) const;
81
82 MCAPI int getInt(int index) const;
83
84 MCAPI int64 getInt64(int index) const;
85
86 MCAPI ::std::string const& getString(int index) const;
87
88 MCFOLD ::Tag::Type getType() const;
89
90 MCAPI int size() const;
91 // NOLINTEND
92
93public:
94 // constructor thunks
95 // NOLINTBEGIN
96 MCAPI void* $ctor();
97 // NOLINTEND
98
99public:
100 // virtual function thunks
101 // NOLINTBEGIN
102 MCAPI void $write(::IDataOutput& dos) const;
103
104 MCAPI ::Bedrock::Result<void> $load(::IDataInput& dis);
105
106 MCFOLD ::Tag::Type $getId() const;
107
108 MCAPI ::std::string $toString() const;
109
110 MCAPI void $print(::std::string const& prefix_, ::PrintStream& out) const;
111
112 MCAPI ::std::unique_ptr<::Tag> $copy() const;
113
114 MCAPI uint64 $hash() const;
115
116 MCAPI bool $equals(::Tag const& rhs) const;
117
118 MCFOLD void $deleteChildren();
119
120
121 // NOLINTEND
122
123public:
124 // vftables
125 // NOLINTBEGIN
126 MCNAPI static void** $vftable();
127 // NOLINTEND
128};
Definition CompoundTagVariant.h:28
Definition CompoundTag.h:23
Definition IDataInput.h:8
Definition IDataOutput.h:5
static MCAPI void ** $vftable()
Definition PrintStream.h:5
Definition function_ref.h:60