From 643f71d961bd77f7293e7b3dbfe9df3116c1767f Mon Sep 17 00:00:00 2001 From: darcy Date: Tue, 3 Dec 2024 19:22:04 +1100 Subject: [PATCH] Make `HeightMap` iterator work when `const` --- include/mcpp/util.h | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/include/mcpp/util.h b/include/mcpp/util.h index e03d94f..f14e95a 100644 --- a/include/mcpp/util.h +++ b/include/mcpp/util.h @@ -343,8 +343,9 @@ struct HeightMap { pointer m_ptr; }; - Iterator begin() { return Iterator(&raw_heights[0]); } - Iterator end() { return Iterator(&raw_heights[_x_len * _z_len]); } + Iterator begin() const { return Iterator(&raw_heights[0]); } + Iterator end() const { return Iterator(&raw_heights[_x_len * _z_len]); } + HeightMap(const Coordinate& loc1, const Coordinate& loc2, const std::vector& heights);