From 59e0ce1f0c9c1076ebbd1a4667fa303642f43f33 Mon Sep 17 00:00:00 2001 From: Matthias Schiffer Date: Sun, 22 Jul 2018 16:55:04 +0200 Subject: NBT: IntArray: allow accessing individual elements --- src/NBT/IntArrayTag.hpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/NBT/IntArrayTag.hpp b/src/NBT/IntArrayTag.hpp index 67c25b1..4dfcd05 100644 --- a/src/NBT/IntArrayTag.hpp +++ b/src/NBT/IntArrayTag.hpp @@ -58,7 +58,7 @@ public: std::string inner = indent + " "; for (size_t i = 0; i < len; i++) { - uint32_t v = Buffer::parse32(&ptr[4*i]); + uint32_t v = getValue(i); os << inner << v << " / " @@ -77,6 +77,10 @@ public: const uint8_t * getPointer() const { return ptr; } + + uint32_t getValue(size_t i) const { + return Buffer::parse32(&ptr[4*i]); + } }; } -- cgit v1.2.3