#pragma once
#include "constants.hpp"
#include "stats.hpp"
#include "levelmanager.hpp"
#include "fsm.hpp"
#include "main_ui.hpp"
#include "combat_ui.hpp"
#include "status_ui.hpp"
#include "arena_ui.hpp"
#include "map_view.hpp"
#include "mini_map.hpp"

namespace arena {
  enum class State {
    START,
    IDLE,
    END
  };

  enum class Event {
    STARTED=0,
    TICK=1,
    CLOSE = 7,
    ATTACK = 10,
    QUIT = 14
  };

  class FSM : public DeadSimpleFSM<State, Event> {
    public:
      std::string $enemy_name;
      sf::RenderWindow $window;
      sf::Font $font;
      LevelManager $level_mgr;
      GameLevel $level;
      shared_ptr<arena::ArenaUI> $arena_ui = nullptr;

      FSM(std::string enemy_name);

      void event(Event ev);
      void START(Event );
      void IDLE(Event ev);
      void END(Event ev);

      void try_move(int dir, bool strafe);
      void keyboard_mouse();
      void draw_gui();
      void render();
      bool active();
      void run_systems();
      void handle_world_events();
  };
}
