#ifndef WORLD_H
#define WORLD_H

#include <unordered_map>
#include <optional>

#include <glm/glm.hpp>

#include "Chunk.h"

class World
{
  public:
    std::unordered_map<glm::ivec3, Chunk> chunks;

    World();

    void set_voxel(glm::ivec3 position, std::optional<VoxelKind> kind);

    std::optional<std::pair<glm::ivec3, glm::ivec3>> raycast_voxel(glm::vec3 start, glm::vec3 direction, float max_dist);

    std::optional<VoxelKind> get_voxel(glm::ivec3 position);

    Chunk* get_or_create_chunk(glm::ivec3 chunk_position);
};

#endif WORLD_H
