#ifndef __STATES__STATE_MANAGER_H__
#define __STATES__STATE_MANAGER_H__

#include <vector>
#include <memory>
#include <SDL2/SDL.h>
#include "BaseState.h"

class StateManager
{
public:
    ~StateManager() = default;
    
    void PushState(std::unique_ptr<BaseState> state, Engine& engine);
    void PopState(Engine& engine);
    void ChangeState(std::unique_ptr<BaseState> state, Engine& engine);
    
    void HandleEvents(Engine& engine, SDL_Event& e);
    void Update(Engine& engine, float dt);
    void Render(Engine& engine);
    void RenderImGui(Engine& engine);
    
    BaseState* GetCurrentState() const;
    std::vector<std::string> GetStack() const;
    bool IsEmpty() const { return states.empty(); }

private:
    std::vector<std::unique_ptr<BaseState>> states;

};

#endif