22 #ifndef AI_MANAGER_HPP_INCLUDED
23 #define AI_MANAGER_HPP_INCLUDED
29 #include <boost/shared_ptr.hpp>
35 namespace ai {
class ai_composite; }
36 namespace ai {
class ai_context; }
37 namespace ai {
class component; }
38 namespace ai {
class default_ai_context; }
39 namespace ai {
class readonly_context; }
40 namespace ai {
class readwrite_context; }
41 namespace ai {
class side_context; }
469 static std::deque< command_history_item >
history_;
static void add_observer(events::observer *event_observer)
Adds observer of game events.
static const std::string AI_TYPE_DFOOL_AI
static void raise_gamestate_changed()
Notifies all observers of 'ai_gamestate_changed' event.
static void raise_map_changed()
Notifies all observers of 'ai_map_changed' event.
readonly_context * readonly_context_
static game_info & get_active_ai_info_for_side(side_number side)
Gets AI info for active AI of the given side.
static void add_turn_started_observer(events::observer *event_observer)
Adds an observer of 'ai_turn_started' event.
holder(side_number side, const config &cfg)
const std::string get_ai_identifier() const
static events::generic_event gamestate_changed_
Class that manages AIs for all sides and manages AI redeployment.
void modify_side_ai_config(config cfg)
const std::string number
template to number regex
static const std::string internal_evaluate_command(side_number side, const std::string &str)
Evaluates an internal manager command.
Definitions for the interface to Wesnoth Markup Language (WML).
std::pair< const_child_iterator, const_child_iterator > const_child_itors
static void add_tod_changed_observer(events::observer *event_observer)
Adds an observer of 'ai_tod_changed' event.
command_history_item(int number, const std::string &command)
static AI_map_of_stacks ai_map_
const std::string get_ai_overview()
void init(side_number side)
static bool should_intercept(const std::string &str)
Determines if the command should be intercepted and evaluated as internal command.
static std::stack< holder > & get_or_create_ai_stack_for_side(side_number side)
Gets the AI stack for the specified side, create it if it doesn't exist.
static bool add_ai_for_side_from_file(side_number side, const std::string &file, bool replace=true)
Adds active AI for specified side from file.
static void clear_ais()
Clears all the AIs.
static void raise_recruit_list_changed()
Notifies all observers of 'ai_recruit_list_changed' event.
const std::string get_ai_structure()
A small explanation about what's going on here: Each action has access to two game_info objects First...
static void remove_gamestate_observer(events::observer *event_observer)
Removes an observer of game events except ai_user_interact event and ai_sync_network event...
const std::string & get_command() const
GLsizei const char ** path
static std::deque< command_history_item > history_
component * get_component(component *root, const std::string &path)
static void remove_turn_started_observer(events::observer *event_observer)
Deletes an observer of 'ai_turn_started' event.
static std::string get_active_ai_overview_for_side(side_number side)
Gets AI Overview for active AI of the given side.
static void set_ai_info(const game_info &info)
Sets AI information.
static events::generic_event user_interact_
static bool add_ai_for_side(side_number side, const std::string &ai_algorithm_type, bool replace=true)
Adds active AI for specified side from parameters.
static config to_config(side_number side)
Gets AI config for active AI of the given side.
static const std::string AI_TYPE_AI2
side_context * side_context_
static void play_turn(side_number side)
Plays a turn for the specified side using its active AI.
static void modify_active_ai_for_side(ai::side_number side, const config &cfg)
Modifies AI parameters for active AI of the given side.
void modify_ai(const config &cfg)
static void remove_all_ais_for_side(side_number side)
Removes all AIs from side.
static const std::string AI_TYPE_DEFAULT
static const std::string AI_TYPE_IDLE_AI
static void clear_ai_info()
Clears AI information.
static void remove_ai_for_side(side_number side)
Removes top-level AI from side.
boost::shared_ptr< ai_composite > composite_ai_ptr
static const std::string evaluate_command(side_number side, const std::string &str)
Evaluates a string command using command AI.
static events::generic_event sync_network_
static void raise_user_interact()
Notifies all observers of 'ai_user_interact' event.
static const std::string AI_TYPE_COMPOSITE_AI
Game information for the AI.
static std::string get_active_ai_identifier_for_side(side_number side)
Gets AI algorithm identifier for active AI of the given side.
static events::generic_event map_changed_
static void add_recruit_list_changed_observer(events::observer *event_observer)
Adds an observer of 'ai_recruit_list_changed' event.
static void remove_tod_changed_observer(events::observer *event_observer)
Deletes an observer of 'ai_tod_changed' event.
static game_info * ai_info_
static events::generic_event turn_started_
static long history_item_counter_
default_ai_context * default_ai_context_
static const size_t MAX_HISTORY_SIZE
static bool add_ai_for_side_from_config(side_number side, const config &cfg, bool replace=true)
Adds active AI for specified side from cfg.
static std::string get_active_ai_structure_for_side(side_number side)
Gets AI Structure for active AI of the given side.
static events::generic_event tod_changed_
readwrite_context * readwrite_context_
std::map< side_number, std::stack< holder > > AI_map_of_stacks
Handling of system events.
std::string replace(std::string str, const std::string &src, const std::string &dst)
Replace all instances of src in str with dst.
const std::string describe_ai()
static void remove_observer(events::observer *event_observer)
Removes an observer of game events.
static const std::string AI_TYPE_FORMULA_AI
ai_composite & get_ai_ref()
static const std::string AI_TYPE_SAMPLE_AI
static game_info & get_ai_info()
Gets global AI-game info.
static void add_gamestate_observer(events::observer *event_observer)
Adds observer of game events except ai_user_interact event and ai_sync_network event.
static void raise_sync_network()
Notifies all observers of 'ai_sync_network' event.
static ai_composite & get_active_ai_for_side(side_number side)
Gets active AI for specified side.
static void raise_tod_changed()
Notifies all observers of 'ai_tod_changed' event.
A config object defines a single node in a WML file, with access to child nodes.
static ai::holder & get_active_ai_holder_for_side_dbg(side_number side)
Gets the active AI holder for debug purposes.
static int last_interact_
GLsizei const GLcharARB ** string
static void remove_recruit_list_changed_observer(events::observer *event_observer)
Deletes an observer of 'ai_recruit_list_changed' event.
static events::generic_event recruit_list_changed_
static void raise_turn_started()
Notifies all observers of 'ai_turn_started' event.
Base class that holds the AI and current AI parameters.
static holder & get_active_ai_holder_for_side(side_number side)
Gets active holder for specified side.
static void add_map_changed_observer(events::observer *event_observer)
Adds an observer of 'ai_map_changed' event.
static void modify_active_ai_config_old_for_side(side_number side, const config::const_child_itors &ai_parameters)
Modifies AI parameters for active AI of the given side.
static void remove_map_changed_observer(events::observer *event_observer)
Deletes an observer of 'ai_map_changed' event.