#pragma once #include namespace MC::World { struct ChunkIndex { ChunkIndex() : x(0), y(0) {} ChunkIndex(int32_t x, int32_t y) : x(x), y(y) {} Vector<3> middle() const { return {(x + 0.5f) * Chunk::Width, Chunk::Height / 2.0f, (y + 0.5f) * Chunk::Width}; } int32_t x, y; }; } template<> struct std::equal_to { bool operator()(const MC::World::ChunkIndex& i1, const MC::World::ChunkIndex& i2) const noexcept { return i1.x == i2.x && i1.y == i2.y; } }; template<> struct std::hash { size_t operator()(const MC::World::ChunkIndex& i) const noexcept { return (int64_t)i.x << 32 | i.y; } };