#pragma once

#include "../../core/world/Area.hpp"

namespace world::client {
    /// Area (aka big group of client::Chunk)
    struct Area final: public world::Area {
    public:
        Area(const params& p): world::Area(p.center, p.radius), curvature(p.curvature) { }

        std::optional<double> getCurvature() const override { return curvature; }

        void update(const params& p) {
            assert(getChunks().getRadius() == p.radius);
            center = p.center;
            curvature = p.curvature;
        }

        robin_hood::unordered_map<region_pos, robin_hood::unordered_map<region_chunk_pos, Voxel>> regionCache;

    private:
        std::optional<double> curvature;
    };
}