#pragma once
#include <cstdint>
#include <vector>
#include <string>
#include <SFML/Graphics.hpp>
#include <unordered_map>
#include <memory>
#include "matrix.hpp"

namespace textures {

  struct SpriteTexture {
    std::string name;
    std::shared_ptr<sf::Sprite> sprite = nullptr;
    std::shared_ptr<sf::Texture> texture = nullptr;
  };

  struct TextureManager {
    std::vector<sf::Image> surfaces;
    std::unordered_map<std::string, SpriteTexture> sprite_textures;
    std::unordered_map<wchar_t, int> char_to_texture;
    sf::Image floor;
    sf::Image ceiling;
  };

  void init();

  SpriteTexture get(std::string name);

  sf::Image load_image(std::string filename);

  const uint32_t* get_surface(size_t num);

  matrix::Matrix convert_char_to_texture(matrix::Matrix &from);

  const uint32_t* get_floor();

  const uint32_t* get_ceiling();
}