#ifndef APPLICATION_H
#define APPLICATION_H

#include <memory>
#include <array>
#include <SFML/System/Clock.hpp>
#include <SFML/Window/Keyboard.hpp>
#include <SFML/Window/Event.hpp>

#include "game/game.h"
#include "gui/state.h"

#include "tools/resourceholder.h"

class Application
{
public:
    Application();
    void run();
    void input();
    void update(const sf::Time& dt);
    void draw();

private:
    std::array<std::shared_ptr<GUIState>, GUIState::Tag::AMOUNT> _states;
    std::vector<std::shared_ptr<GUIState>> _state_stack;


    sf::RenderWindow _game_window;
    std::shared_ptr<Game> _game;

    void exec();
    void pushState(GUIState::Tag new_state);
    void popState();

    FontHolder _font_holder;
};

#endif // APPLICATION_H