#ifndef DIRECTOR_H #define DIRECTOR_H #include "galaxy.h" #include "session_common.h" #include class Dispatch; class MenuDispatch; class InputDispatch; class Director { public: /** * This dispatches client_input, server_line and server_prompt. * * Set chain.setNotify() to get a response when it is done. * activate() to begin the chain. * * The chain has to_client, to_server functions that dispatch to those * functions in Dispatch/Director/Session. */ std::shared_ptr chain; StringFunc to_client; // StringFunc to_server; std::function to_server; // void Session::post(notifyFunc nf) std::function post; void client_input(const std::string &input); void server_line(const std::string &line, const std::string &raw_line); void server_prompt(const std::string &prompt, const std::string &raw_prompt); bool active; // not sure if I need these or not? std::string current_raw_prompt; std::string current_prompt; std::string old_prompt; std::string old_raw_prompt; void proxy_activate(); void proxy_deactivate(); char game; // 0 = not in a game // not sure on these... or how I want to use them. // maybe this is the place for these?! // IF these are public -- Session can access them. :P bool show_client; bool talk_direct; // maybe these would work better? std::function set_show_client; std::function set_talk_direct; Director(); ~Director(); int count; int current_sector; Galaxy galaxy; std::string username; private: void build_menu(void); std::shared_ptr main_menu; std::shared_ptr cim; std::shared_ptr config_input; std::shared_ptr edit_input; std::shared_ptr scripts_menu; std::shared_ptr script; std::shared_ptr macro_input; InputDispatch *init_config_input(void); InputDispatch *init_edit_input(void); InputDispatch *init_macro_input(void); MenuDispatch *init_scripts_menu(void); // notifications void have_input(void); void menu_choice(void); void cim_done(void); void scripts_done(void); void information(void); void config_edit(void); void config_have_input(void); std::string config_item; // current item being edited void macro_edit(void); void macro_have_input(void); std::string macro_item; StringFunc SL_parser; StringFunc SF_cimline, SF_sectorline, SF_portline, SF_warpline, SF_infoline, SF_densityline, SF_computer_portline, SF_planetline; void SL_cimline(const std::string &line); void SL_thiefline(const std::string &line); void SL_sectorline(const std::string &line); void SL_portline(const std::string &line); void SL_computer_portline(const std::string &line); void SL_warpline(const std::string &line); void SL_infoline(const std::string &line); void SL_densityline(const std::string &line); void SL_planetline(const std::string &line); int computer_port_sector; bool computer_port_done; boost::circular_buffer SL_history{10}; }; #include "dispatchers.h" #endif