LeviLamina
Loading...
Searching...
No Matches
ByteTag.h
1#pragma once
2
3#include "mc/_HeaderOutputPredefine.h"
4
5// auto generated inclusion list
6#include "mc/deps/nbt/Tag.h"
7#include "mc/platform/Result.h"
8
9// auto generated forward declare list
10// clang-format off
11class IDataInput;
12class IDataOutput;
13// clang-format on
14
15class ByteTag : public ::Tag {
16public:
17 schar data;
18
19 template <std::integral T>
20 constexpr ByteTag& operator=(T value) {
21 data = (schar)value;
22 return *this;
23 }
24
25 template <std::integral T>
26 [[nodiscard]] constexpr operator T() const {
27 return (T)data;
28 }
29
30 [[nodiscard]] constexpr operator std::byte() const { return (std::byte)data; }
31
32 template <std::integral T>
33 [[nodiscard]] constexpr explicit ByteTag(T value = 0) : data((schar)value) {}
34
35 [[nodiscard]] constexpr ByteTag() : data(0) {}
36
37 [[nodiscard]] constexpr explicit ByteTag(std::byte b) : data(std::to_integer<schar>(b)) {}
38
39 [[nodiscard]] ByteTag operator-() const { return ByteTag{-data}; }
40
41public:
42 // virtual functions
43 // NOLINTBEGIN
44 virtual void write(::IDataOutput& dos) const /*override*/;
45
46 virtual ::Bedrock::Result<void> load(::IDataInput& dis) /*override*/;
47
48 virtual ::Tag::Type getId() const /*override*/;
49
50 virtual ::std::string toString() const /*override*/;
51
52 virtual bool equals(::Tag const& rhs) const /*override*/;
53
54 virtual ::std::unique_ptr<::Tag> copy() const /*override*/;
55
56 virtual uint64 hash() const /*override*/;
57 // NOLINTEND
58
59public:
60 // virtual function thunks
61 // NOLINTBEGIN
62 MCAPI void $write(::IDataOutput& dos) const;
63
64 MCAPI ::Bedrock::Result<void> $load(::IDataInput& dis);
65
66 MCFOLD ::Tag::Type $getId() const;
67
68 MCAPI ::std::string $toString() const;
69
70 MCAPI bool $equals(::Tag const& rhs) const;
71
72 MCAPI ::std::unique_ptr<::Tag> $copy() const;
73
74 MCAPI uint64 $hash() const;
75
76
77 // NOLINTEND
78
79public:
80 // vftables
81 // NOLINTBEGIN
82 MCNAPI static void** $vftable();
83 // NOLINTEND
84};
85namespace ll::inline literals::inline nbt_literals {
86[[nodiscard]] inline ByteTag operator""_b(uint64 num) { return ByteTag{(schar)num}; }
87} // namespace ll::inline literals::inline nbt_literals
Definition ByteTag.h:15
static MCAPI void ** $vftable()
Definition IDataInput.h:8
Definition IDataOutput.h:5