#pragma once

#include "resource/character.hpp"
#include "resource/font.hpp"
#include "resource/schema.hpp"
#include "resource/shader.hpp"

namespace game
{
  class Resources
  {
  public:
    resource::Shader shaders[resource::shader::COUNT];
    resource::Font font{"resources/font/font.ttf"};
    resource::xml::Schema settings;

    std::vector<resource::xml::Schema> characterPreviews{};
    std::vector<resource::xml::Schema> characterSaves{};
    std::vector<resource::xml::Character> characters{};

    bool isDeveloper{};

    Resources();
    ~Resources();

    void characters_refresh();
    resource::xml::Character& character_get(int index);
    resource::xml::Schema& character_preview_get(int index);
    int character_index_get(const std::string& key) const;
    std::string character_key_get(int index) const;
    void last_character_save(int index);
    void last_character_clear();
    void character_save_set(int index, const resource::xml::Schema& save);
    void character_save_clear(int index);

    void volume_set(float volume);
    void audio_mute_set(bool isMuted);
  };
}
