35 namespace ai {
class unit_advancements_aspect; }
36 namespace ai {
class ai_composite; }
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; }
493 friend class ::game_launcher;
const std::string & get_command() const
command_history_item(int number, const std::string &command)
Base class that holds the AI and current AI parameters.
std::string describe_ai() const
std::string get_ai_structure()
std::string get_ai_identifier() const
void micro_ai(const config &cfg)
void modify_ai(const config &cfg)
ai_composite & get_ai_ref()
component * get_component(component *root, const std::string &path)
std::unique_ptr< side_context > side_context_
std::unique_ptr< readwrite_context > readwrite_context_
std::string get_ai_overview()
std::unique_ptr< readonly_context > readonly_context_
void init(side_number side)
void append_ai(const config &cfg)
std::unique_ptr< default_ai_context > default_ai_context_
holder(side_number side, const config &cfg)
Class that manages AIs for all sides and manages AI redeployment.
static const std::string AI_TYPE_SAMPLE_AI
events::generic_event map_changed_
std::string get_active_ai_identifier_for_side(side_number side)
Gets AI algorithm identifier for active AI of the given side.
void clear_ais()
Clears all the AIs.
std::string get_active_ai_overview_for_side(side_number side)
Gets AI Overview for active AI of the given side.
ai_composite & get_active_ai_for_side(side_number side)
Gets active AI for specified side.
void raise_tod_changed()
Notifies all observers of 'ai_tod_changed' event.
bool add_ai_for_side_from_config(side_number side, const config &cfg, bool replace=true)
Adds active AI for specified side from cfg.
config to_config(side_number side)
Gets AI config for active AI of the given side.
events::generic_event user_interact_
void remove_all_ais_for_side(side_number side)
Removes all AIs from side.
void remove_gamestate_observer(events::observer *event_observer)
Removes an observer of game events except ai_user_interact event and ai_sync_network event.
void remove_observer(events::observer *event_observer)
Removes an observer of game events.
void raise_turn_started()
Notifies all observers of 'ai_turn_started' event.
static manager * singleton_
static const std::string AI_TYPE_IDLE_AI
static const std::string AI_TYPE_COMPOSITE_AI
static const std::size_t MAX_HISTORY_SIZE
static const std::string AI_TYPE_DFOOL_AI
void raise_gamestate_changed()
Notifies all observers of 'ai_gamestate_changed' event.
void add_gamestate_observer(events::observer *event_observer)
Adds observer of game events except ai_user_interact event and ai_sync_network event.
void append_active_ai_for_side(ai::side_number side, const config &cfg)
Appends AI parameters to active AI of the given side.
std::map< side_number, std::stack< holder > > AI_map_of_stacks
std::string get_active_ai_structure_for_side(side_number side)
Gets AI Structure for active AI of the given side.
events::generic_event sync_network_
void raise_user_interact()
Notifies all observers of 'ai_user_interact' event.
static const std::string AI_TYPE_FORMULA_AI
events::generic_event recruit_list_changed_
const std::string evaluate_command(side_number side, const std::string &str)
Evaluates a string command using command AI.
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.
holder & get_active_ai_holder_for_side(side_number side)
Gets active holder for specified side.
void add_recruit_list_changed_observer(events::observer *event_observer)
Adds an observer of 'ai_recruit_list_changed' event.
game_info & get_active_ai_info_for_side(side_number side)
Gets AI info for active AI of the given side.
void add_map_changed_observer(events::observer *event_observer)
Adds an observer of 'ai_map_changed' event.
static manager & get_singleton()
static const std::string AI_TYPE_AI2
void add_turn_started_observer(events::observer *event_observer)
Adds an observer of 'ai_turn_started' event.
static const std::string AI_TYPE_DEFAULT
std::deque< command_history_item > history_
static bool has_manager()
game_info & get_ai_info()
Gets global AI-game info.
events::generic_event gamestate_changed_
const ai::unit_advancements_aspect & get_advancement_aspect_for_side(side_number side)
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.
events::generic_event turn_started_
void remove_ai_for_side(side_number side)
Removes top-level AI from side.
void modify_active_ai_for_side(ai::side_number side, const config &cfg)
Modifies AI parameters for active AI of the given side.
void play_turn(side_number side)
Plays a turn for the specified side using its active AI.
std::chrono::steady_clock::time_point last_interact_
const std::string internal_evaluate_command(side_number side, const std::string &str)
Evaluates an internal manager command.
long history_item_counter_
void raise_map_changed()
Notifies all observers of 'ai_map_changed' event.
bool should_intercept(const std::string &str) const
Determines if the command should be intercepted and evaluated as internal command.
void raise_recruit_list_changed()
Notifies all observers of 'ai_recruit_list_changed' event.
void remove_turn_started_observer(events::observer *event_observer)
Deletes an observer of 'ai_turn_started' event.
ai::holder & get_active_ai_holder_for_side_dbg(side_number side)
Gets the active AI holder for debug purposes.
void raise_sync_network()
Notifies all observers of 'ai_sync_network' event.
events::generic_event tod_changed_
void remove_map_changed_observer(events::observer *event_observer)
Deletes an observer of 'ai_map_changed' event.
void add_tod_changed_observer(events::observer *event_observer)
Adds an observer of 'ai_tod_changed' event.
void remove_tod_changed_observer(events::observer *event_observer)
Deletes an observer of 'ai_tod_changed' event.
void add_observer(events::observer *event_observer)
Adds observer of game events.
void remove_recruit_list_changed_observer(events::observer *event_observer)
Deletes an observer of 'ai_recruit_list_changed' event.
A config object defines a single node in a WML file, with access to child nodes.
Definitions for the interface to Wesnoth Markup Language (WML).
Game information for the AI.
A small explanation about what's going on here: Each action has access to two game_info objects First...
std::unique_ptr< ai_composite > composite_ai_ptr