#pragma once

#include "dinkyecs.hpp"
#include "boss/ui.hpp"
#include "dinkyecs.hpp"
#include "lights.hpp"
#include "map.hpp"
#include <memory>
#include "spatialmap.hpp"

namespace components {
  struct Position;
}

namespace GameDB {
  struct Level {
    size_t index;
    DinkyECS::Entity player;
    std::shared_ptr<Map> map = nullptr;
    std::shared_ptr<DinkyECS::World> world = nullptr;
    std::shared_ptr<lighting::LightRender> lights = nullptr;
    std::shared_ptr<SpatialMap> collision = nullptr;
  };

  std::shared_ptr<boss::UI> create_bossfight();
  Level& create_level();

  void init();
  Level &current_level();
  std::shared_ptr<DinkyECS::World> current_world();
  components::Position& player_position();
  DinkyECS::Entity the_player();

  void load_configs(DinkyECS::World &world);
}
