summaryrefslogtreecommitdiffhomepage
path: root/src/chunk.hpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/chunk.hpp')
-rw-r--r--src/chunk.hpp26
1 files changed, 15 insertions, 11 deletions
diff --git a/src/chunk.hpp b/src/chunk.hpp
index 564f049e..fa3f6979 100644
--- a/src/chunk.hpp
+++ b/src/chunk.hpp
@@ -12,26 +12,30 @@ struct chunk final
friend struct tile_ref;
friend struct pass_mode_ref;
- tile_ref operator[](std::size_t idx) noexcept { return { *this, std::uint8_t(idx) }; }
- tile_proto operator[](std::size_t idx) const noexcept { return tile_proto(tile_ref { *const_cast<chunk*>(this), std::uint8_t(idx) }); }
- tile_ref operator[](local_coords xy) noexcept { return operator[](xy.to_index()); }
- tile_proto operator[](local_coords xy) const noexcept { return operator[](xy.to_index()); }
+ tile_ref operator[](std::size_t idx) noexcept;
+ tile_proto operator[](std::size_t idx) const noexcept;
+ tile_ref operator[](local_coords xy) noexcept;
+ tile_proto operator[](local_coords xy) const noexcept;
using iterator = tile_iterator;
+ using const_iterator = tile_const_iterator;
- iterator begin() noexcept { return iterator { *this, 0 }; }
- iterator end() noexcept { return iterator { *this, TILE_COUNT }; }
+ iterator begin() noexcept;
+ iterator end() noexcept;
+ const_iterator cbegin() const noexcept;
+ const_iterator cend() const noexcept;
+ const_iterator begin() const noexcept;
+ const_iterator end() const noexcept;
bool empty(bool force = false) const noexcept;
chunk() noexcept = default;
-
- fm_DECLARE_DELETED_COPY_ASSIGNMENT(chunk);
- fm_DECLARE_DEFAULT_MOVE_ASSIGNMENT_(chunk);
+ chunk(const chunk&) = delete;
+ chunk& operator=(const chunk&) = delete;
+ chunk(chunk&&) noexcept;
+ chunk& operator=(chunk&&) noexcept;
private:
- static constexpr std::size_t PASS_BITS = 2;
-
std::array<std::shared_ptr<tile_atlas>, TILE_COUNT> _ground_atlases, _wall_north_atlases, _wall_west_atlases;
std::array<std::uint16_t, TILE_COUNT> _ground_variants = {}, _wall_north_variants = {}, _wall_west_variants = {};
std::bitset<TILE_COUNT*2> _passability = {};