#pragma once

#include <vector>
#include <memory>
#include <array>

#include "../../include/application/state.h" // HOW? WHY DOESN'T "application/state.h" LINK ON BY ITSELF
#include "core/corefactory.h"

class Application
{
public:
    virtual ~Application() = default;
    virtual bool init();
    virtual void display() = 0;
    virtual void run() = 0;

    void input(const kku::SystemEvent& input);
    void update(const kku::microsec& dt);

protected:
    std::shared_ptr<kku::CoreFactory> _core_factory;

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

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