summaryrefslogtreecommitdiffstats
path: root/src/NBT
diff options
context:
space:
mode:
authorMatthias Schiffer <mschiffer@universe-factory.net>2018-07-22 16:55:04 +0200
committerMatthias Schiffer <mschiffer@universe-factory.net>2018-07-22 16:55:04 +0200
commit59e0ce1f0c9c1076ebbd1a4667fa303642f43f33 (patch)
tree3e0f6053c3a8d5c20759567382fccd3d0e813987 /src/NBT
parent73a072c2ca7de4eed499e0642cab037b3f237bd9 (diff)
downloadMinedMap-59e0ce1f0c9c1076ebbd1a4667fa303642f43f33.tar
MinedMap-59e0ce1f0c9c1076ebbd1a4667fa303642f43f33.zip
NBT: IntArray: allow accessing individual elements
Diffstat (limited to 'src/NBT')
-rw-r--r--src/NBT/IntArrayTag.hpp6
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]);
+ }
};
}