#pragma once #include "../Common/Sizes.hpp" namespace MC::World { struct ChunkIndex { ChunkIndex() : x(0), y(0) {} ChunkIndex(I32 x, I32 y) : x(x), y(y) {} Vector<3> middle() const { return {(x + 0.5f) * Chunk::Width, Chunk::Height / 2.0f, (y + 0.5f) * Chunk::Width}; } I32 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 { USize operator()(const MC::World::ChunkIndex& i) const noexcept { return (I64)i.x << 32 | i.y; } };