diff options
-rw-r--r-- | src/NBT/ByteArrayTag.hpp | 5 | ||||
-rw-r--r-- | src/NBT/ByteTag.hpp | 4 | ||||
-rw-r--r-- | src/NBT/CompoundTag.hpp | 5 | ||||
-rw-r--r-- | src/NBT/DoubleTag.hpp | 4 | ||||
-rw-r--r-- | src/NBT/EndTag.hpp | 5 | ||||
-rw-r--r-- | src/NBT/FloatTag.hpp | 5 | ||||
-rw-r--r-- | src/NBT/IntArrayTag.hpp | 4 | ||||
-rw-r--r-- | src/NBT/IntTag.hpp | 4 | ||||
-rw-r--r-- | src/NBT/ListTag.hpp | 4 | ||||
-rw-r--r-- | src/NBT/LongArrayTag.hpp | 4 | ||||
-rw-r--r-- | src/NBT/LongTag.hpp | 4 | ||||
-rw-r--r-- | src/NBT/ShortTag.hpp | 4 | ||||
-rw-r--r-- | src/NBT/StringTag.hpp | 4 |
13 files changed, 13 insertions, 43 deletions
diff --git a/src/NBT/ByteArrayTag.hpp b/src/NBT/ByteArrayTag.hpp index 36d9fe7..1e4f2f9 100644 --- a/src/NBT/ByteArrayTag.hpp +++ b/src/NBT/ByteArrayTag.hpp @@ -36,17 +36,14 @@ namespace NBT { class ByteArrayTag : public Tag { private: - friend class Tag; - uint32_t len; const uint8_t *value; +public: ByteArrayTag(Buffer *buffer) { len = buffer->get32(); value = buffer->get(len); } - -public: virtual Type getType() const { return Type::ByteArray; } diff --git a/src/NBT/ByteTag.hpp b/src/NBT/ByteTag.hpp index dc7e212..28b8b1a 100644 --- a/src/NBT/ByteTag.hpp +++ b/src/NBT/ByteTag.hpp @@ -34,15 +34,13 @@ namespace NBT { class ByteTag : public Tag { private: - friend class Tag; - uint8_t value; +public: ByteTag(Buffer *buffer) { value = buffer->get8(); } -public: virtual Type getType() const { return Type::Byte; } diff --git a/src/NBT/CompoundTag.hpp b/src/NBT/CompoundTag.hpp index 6be0479..310b995 100644 --- a/src/NBT/CompoundTag.hpp +++ b/src/NBT/CompoundTag.hpp @@ -36,9 +36,7 @@ namespace MinedMap { namespace NBT { class CompoundTag : public Tag, public std::unordered_map<std::string, std::shared_ptr<const Tag>> { -private: - friend class Tag; - +public: CompoundTag(Buffer *buffer) { while (true) { std::pair<std::string, std::shared_ptr<const Tag>> v = Tag::readNamedTag(buffer); @@ -49,7 +47,6 @@ private: } } -public: virtual Type getType() const { return Type::Compound; } diff --git a/src/NBT/DoubleTag.hpp b/src/NBT/DoubleTag.hpp index 035ff94..3dfdb74 100644 --- a/src/NBT/DoubleTag.hpp +++ b/src/NBT/DoubleTag.hpp @@ -34,15 +34,13 @@ namespace NBT { class DoubleTag : public Tag { private: - friend class Tag; - const uint8_t *ptr; +public: DoubleTag(Buffer *buffer) { ptr = buffer->get(8); } -public: virtual Type getType() const { return Type::Double; } diff --git a/src/NBT/EndTag.hpp b/src/NBT/EndTag.hpp index 4582f5d..5f771fd 100644 --- a/src/NBT/EndTag.hpp +++ b/src/NBT/EndTag.hpp @@ -33,12 +33,9 @@ namespace MinedMap { namespace NBT { class EndTag : public Tag { -private: - friend class Tag; - +public: EndTag() {} -public: virtual Type getType() const { return Type::End; } diff --git a/src/NBT/FloatTag.hpp b/src/NBT/FloatTag.hpp index 7bb8df2..4442f1a 100644 --- a/src/NBT/FloatTag.hpp +++ b/src/NBT/FloatTag.hpp @@ -33,16 +33,13 @@ namespace MinedMap { namespace NBT { class FloatTag : public Tag { -private: - friend class Tag; - const uint8_t *ptr; +public: FloatTag(Buffer *buffer) { ptr = buffer->get(4); } -public: virtual Type getType() const { return Type::Float; } diff --git a/src/NBT/IntArrayTag.hpp b/src/NBT/IntArrayTag.hpp index 1b40a1d..b7a27b4 100644 --- a/src/NBT/IntArrayTag.hpp +++ b/src/NBT/IntArrayTag.hpp @@ -36,17 +36,15 @@ namespace NBT { class IntArrayTag : public Tag { private: - friend class Tag; - uint32_t len; const uint8_t *ptr; +public: IntArrayTag(Buffer *buffer) { len = buffer->get32(); ptr = buffer->get(4*len); } -public: virtual Type getType() const { return Type::IntArray; } diff --git a/src/NBT/IntTag.hpp b/src/NBT/IntTag.hpp index eacac52..6514546 100644 --- a/src/NBT/IntTag.hpp +++ b/src/NBT/IntTag.hpp @@ -34,15 +34,13 @@ namespace NBT { class IntTag : public Tag { private: - friend class Tag; - const uint8_t *ptr; +public: IntTag(Buffer *buffer) { ptr = buffer->get(4); } -public: virtual Type getType() const { return Type::Int; } diff --git a/src/NBT/ListTag.hpp b/src/NBT/ListTag.hpp index 833c41e..d86abdb 100644 --- a/src/NBT/ListTag.hpp +++ b/src/NBT/ListTag.hpp @@ -48,10 +48,9 @@ public: template<typename T> class ListTag : public ListTagBase, public std::vector<std::shared_ptr<const T>> { private: - friend class Tag; - Type type; +public: ListTag(Type type0, Buffer *buffer) : type(type0) { uint32_t len = buffer->get32(); @@ -61,7 +60,6 @@ private: (*this)[i] = std::static_pointer_cast<const T>(Tag::readTag(type, buffer)); } -public: virtual Type getSubtype() const { return type; } diff --git a/src/NBT/LongArrayTag.hpp b/src/NBT/LongArrayTag.hpp index 84e0bdf..1ca3ae6 100644 --- a/src/NBT/LongArrayTag.hpp +++ b/src/NBT/LongArrayTag.hpp @@ -36,17 +36,15 @@ namespace NBT { class LongArrayTag : public Tag { private: - friend class Tag; - uint32_t len; const uint8_t *ptr; +public: LongArrayTag(Buffer *buffer) { len = buffer->get32(); ptr = buffer->get(8*len); } -public: virtual Type getType() const { return Type::LongArray; } diff --git a/src/NBT/LongTag.hpp b/src/NBT/LongTag.hpp index 4f6bec3..f600d8e 100644 --- a/src/NBT/LongTag.hpp +++ b/src/NBT/LongTag.hpp @@ -34,15 +34,13 @@ namespace NBT { class LongTag : public Tag { private: - friend class Tag; - const uint8_t *ptr; +public: LongTag(Buffer *buffer) { ptr = buffer->get(8); } -public: virtual Type getType() const { return Type::Long; } diff --git a/src/NBT/ShortTag.hpp b/src/NBT/ShortTag.hpp index c08e1fe..c66dc05 100644 --- a/src/NBT/ShortTag.hpp +++ b/src/NBT/ShortTag.hpp @@ -34,15 +34,13 @@ namespace NBT { class ShortTag : public Tag { private: - friend class Tag; - const uint8_t *ptr; +public: ShortTag(Buffer *buffer) { ptr = buffer->get(2); } -public: virtual Type getType() const { return Type::Short; } diff --git a/src/NBT/StringTag.hpp b/src/NBT/StringTag.hpp index 5f68d63..2fda6d3 100644 --- a/src/NBT/StringTag.hpp +++ b/src/NBT/StringTag.hpp @@ -34,17 +34,15 @@ namespace NBT { class StringTag : public Tag { private: - friend class Tag; - uint16_t len; const uint8_t *ptr; +public: StringTag(Buffer *buffer) { len = buffer->get16(); ptr = buffer->get(len); } -public: virtual Type getType() const { return Type::String; } |