diff options
author | Matthias Schiffer <mschiffer@universe-factory.net> | 2018-07-22 16:55:04 +0200 |
---|---|---|
committer | Matthias Schiffer <mschiffer@universe-factory.net> | 2018-07-22 16:55:04 +0200 |
commit | 59e0ce1f0c9c1076ebbd1a4667fa303642f43f33 (patch) | |
tree | 3e0f6053c3a8d5c20759567382fccd3d0e813987 /src | |
parent | 73a072c2ca7de4eed499e0642cab037b3f237bd9 (diff) | |
download | MinedMap-59e0ce1f0c9c1076ebbd1a4667fa303642f43f33.tar MinedMap-59e0ce1f0c9c1076ebbd1a4667fa303642f43f33.zip |
NBT: IntArray: allow accessing individual elements
Diffstat (limited to 'src')
-rw-r--r-- | src/NBT/IntArrayTag.hpp | 6 |
1 files changed, 5 insertions, 1 deletions
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]); + } }; } |