

#ifndef STATES_STATE_MANGER_GUARD
#define STATES_STATE_MANGER_GUARD

#include <iostream>
#include <algorithm>
#include <iterator>
#include <vector>
#include <string>
#include <memory>

#include <SFML/Graphics.hpp>

#include "engine/types/Index_node.hpp"
#include "engine/events/Receiver_forwarder.hpp"
#include "engine/gui/Window.h"

#include "engine/converters/Sfml_event_to_dict.h"
#include "engine/converters/Draw_event_to_dict.h"

#include "utils/typedefs.hpp"

namespace states
{
    class State_manager
    {
        public:
            State_manager ();

            utils::Entry_point get_entry_point () const;
            std::shared_ptr < engine::types::Index_node < utils::Event_receiver > > get_index () const;

            void set_state ( std::shared_ptr < utils::Event_receiver > new_state );
            void add_state ( std::vector < std::string > index_keys, std::shared_ptr < utils::Event_receiver > state );
            void switch_state ( std::vector < std::string > index_keys );
            std::shared_ptr < engine::gui::Window > wrap_window ( std::shared_ptr < sf::RenderWindow > render_window );

        private:
            std::shared_ptr < engine::events::Receiver_forwarder < utils::Event > > entry_point;
            std::shared_ptr < engine::types::Index_node < utils::Event_receiver > > index;
    };
} /* namespace states */

#endif // STATES_STATE_MANGER_GUARD
