#pragma once

#include "core/world/units.hpp"
#include "core/world/forward.h"
#include <memory>
#include <array>

namespace contouring::surrounding {
    typedef std::array<std::shared_ptr<const world::EdittableChunk>, 8> corners;
    const world::chunk_pos g_corner_offsets[8] = {
        world::chunk_pos(0, 0, 0),
        world::chunk_pos(0, 0, 1),
        world::chunk_pos(0, 1, 0),
        world::chunk_pos(0, 1, 1),
        world::chunk_pos(1, 0, 0),
        world::chunk_pos(1, 0, 1),
        world::chunk_pos(1, 1, 0),
        world::chunk_pos(1, 1, 1),
    };

    bool load(corners &out, const world::chunk_pos &chunkPos, const world::ChunkContainer &chunks);
    void load(corners &out, const glm::ucvec3 &areaSize, const glm::ucvec3 &chunkPos, const std::vector<std::shared_ptr<world::EdittableChunk>> &area);
}
