#include "mini_map.hpp"
#include <functional>
#include <string>
#include "dbc.hpp"
#include "components.hpp"
#include "rand.hpp"
#include "animation.hpp"
#include "systems.hpp"
#include "rand.hpp"
#include <codecvt>
#include <iostream>
#include <memory>

namespace gui {
  using namespace components;

  MiniMapUI::MiniMapUI(GameLevel &level) :
    $map_grid{L"...", 45, {200, 200, 200, 100}, 10},
    $level(level)
  {
    $font = std::make_shared<sf::Font>(FONT_FILE_NAME);
  }

  void MiniMapUI::update_level(GameLevel &level) {
    $level = level;
  }

  void MiniMapUI::init(guecs::UI& overlay) {
    auto top_right = overlay.entity("top_right");
    auto cell = overlay.cell_for(top_right);
    $map_grid.init(cell, $font);
  }

  void MiniMapUI::render(sf::RenderWindow &window, int compass_dir) {
    (void)compass_dir;
    $map_grid.update(L"I'M BROKEN");
    window.draw(*$map_grid.text);
  }
}
