#pragma once

#include "config.hpp"
#include "core/world/server_handle.hpp"
#include "core/queue/circular_buffer.hpp"

namespace state {

/// Live state
struct state {
    bool playing = false;
    world::client::Universe::login login{};

    bool useSrv = false;
    world::AbstractServerFactory *srvContainer = nullptr;

    bool capture_mouse = true;
    struct {
        world::relative_transform relative = world::relative_transform{generational::id(), world::transform()};
        world::transform absolute = world::transform();
    } position;
    world::Universe::query_result look_at = {};
    bool can_fill = true;

    contouring::Abstract* contouring;

    struct line {
        std::string text;
        std::optional<uint32_t> color;
    };
    struct {
        std::array<char, 256> buffer = {'\0'};
        data::circular_buffer<line, 1024> lines;
    } console;

    struct {
        bool aabb = false;
        bool obb = false;
        bool chunk = false;
    } indicators;
};

/// Readonly metrics
struct reports {
    size_t tris_count = 0;
    size_t models_count = 0;
};

}