#pragma once

#include "world/Universe.hpp"
#include "world/actions.hpp"
#include "geometry/Faces.hpp"

/// Link between world::server::SharedUniverse and world::client::LocalUniverse
struct server_handle {
    bool running = false;
    const world::client::area_map *areas;
    const data::generational::vector<world::Universe::Entity> *entities;
    std::function<void(const area_<chunk_pos> &pos, const chunk_pos &offset, const world::ChunkContainer &data, geometry::Faces neighbors)> onUpdate;
    std::function<void(const world::action::packet &packet)> emit;
    std::function<world::Universe::ray_result(const geometry::Ray &ray)> raycast;
    std::optional<voxel_pos> teleport;
    std::optional<std::string> message;
    bool entityChange = false;
};
