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