The Battle for Wesnoth  1.19.7+dev
Public Member Functions | Static Public Member Functions | Static Public Attributes | Private Types | Private Member Functions | Private Attributes | Static Private Attributes | Friends | List of all members
ai::manager Class Reference

Class that manages AIs for all sides and manages AI redeployment. More...

#include <manager.hpp>

Public Member Functions

 manager ()
 
 ~manager ()
 
void add_observer (events::observer *event_observer)
 Adds observer of game events. More...
 
void remove_observer (events::observer *event_observer)
 Removes an observer of game events. More...
 
void add_gamestate_observer (events::observer *event_observer)
 Adds observer of game events except ai_user_interact event and ai_sync_network event. More...
 
void remove_gamestate_observer (events::observer *event_observer)
 Removes an observer of game events except ai_user_interact event and ai_sync_network event. More...
 
void raise_user_interact ()
 Notifies all observers of 'ai_user_interact' event. More...
 
void raise_sync_network ()
 Notifies all observers of 'ai_sync_network' event. More...
 
void raise_gamestate_changed ()
 Notifies all observers of 'ai_gamestate_changed' event. More...
 
void raise_tod_changed ()
 Notifies all observers of 'ai_tod_changed' event. More...
 
void raise_recruit_list_changed ()
 Notifies all observers of 'ai_recruit_list_changed' event. More...
 
void raise_turn_started ()
 Notifies all observers of 'ai_turn_started' event. More...
 
void raise_map_changed ()
 Notifies all observers of 'ai_map_changed' event. More...
 
void add_map_changed_observer (events::observer *event_observer)
 Adds an observer of 'ai_map_changed' event. More...
 
void add_recruit_list_changed_observer (events::observer *event_observer)
 Adds an observer of 'ai_recruit_list_changed' event. More...
 
void add_turn_started_observer (events::observer *event_observer)
 Adds an observer of 'ai_turn_started' event. More...
 
void add_tod_changed_observer (events::observer *event_observer)
 Adds an observer of 'ai_tod_changed' event. More...
 
void remove_map_changed_observer (events::observer *event_observer)
 Deletes an observer of 'ai_map_changed' event. More...
 
void remove_recruit_list_changed_observer (events::observer *event_observer)
 Deletes an observer of 'ai_recruit_list_changed' event. More...
 
void remove_turn_started_observer (events::observer *event_observer)
 Deletes an observer of 'ai_turn_started' event. More...
 
void remove_tod_changed_observer (events::observer *event_observer)
 Deletes an observer of 'ai_tod_changed' event. More...
 
const std::string evaluate_command (side_number side, const std::string &str)
 Evaluates a string command using command AI. More...
 
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. More...
 
bool add_ai_for_side_from_config (side_number side, const config &cfg, bool replace=true)
 Adds active AI for specified side from cfg. More...
 
void remove_ai_for_side (side_number side)
 Removes top-level AI from side. More...
 
void remove_all_ais_for_side (side_number side)
 Removes all AIs from side. More...
 
void clear_ais ()
 Clears all the AIs. More...
 
game_infoget_active_ai_info_for_side (side_number side)
 Gets AI info for active AI of the given side. More...
 
std::string get_active_ai_overview_for_side (side_number side)
 Gets AI Overview for active AI of the given side. More...
 
std::string get_active_ai_structure_for_side (side_number side)
 Gets AI Structure for active AI of the given side. More...
 
std::string get_active_ai_identifier_for_side (side_number side)
 Gets AI algorithm identifier for active AI of the given side. More...
 
ai::holderget_active_ai_holder_for_side_dbg (side_number side)
 Gets the active AI holder for debug purposes. More...
 
config to_config (side_number side)
 Gets AI config for active AI of the given side. More...
 
game_infoget_ai_info ()
 Gets global AI-game info. More...
 
const ai::unit_advancements_aspectget_advancement_aspect_for_side (side_number side)
 
void modify_active_ai_for_side (ai::side_number side, const config &cfg)
 Modifies AI parameters for active AI of the given side. More...
 
void append_active_ai_for_side (ai::side_number side, const config &cfg)
 Appends AI parameters to active AI of the given side. More...
 
void play_turn (side_number side)
 Plays a turn for the specified side using its active AI. More...
 

Static Public Member Functions

static managerget_singleton ()
 
static bool has_manager ()
 

Static Public Attributes

static const std::size_t MAX_HISTORY_SIZE = 200
 
static const std::string AI_TYPE_COMPOSITE_AI = "composite_ai"
 
static const std::string AI_TYPE_SAMPLE_AI = "sample_ai"
 
static const std::string AI_TYPE_IDLE_AI = "idle_ai"
 
static const std::string AI_TYPE_FORMULA_AI = "formula_ai"
 
static const std::string AI_TYPE_DFOOL_AI
 
static const std::string AI_TYPE_AI2
 
static const std::string AI_TYPE_DEFAULT = "default"
 

Private Types

typedef std::map< side_number, std::stack< holder > > AI_map_of_stacks
 

Private Member Functions

const std::string internal_evaluate_command (side_number side, const std::string &str)
 Evaluates an internal manager command. More...
 
bool should_intercept (const std::string &str) const
 Determines if the command should be intercepted and evaluated as internal command. More...
 
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. More...
 
holderget_active_ai_holder_for_side (side_number side)
 Gets active holder for specified side. More...
 
ai_compositeget_active_ai_for_side (side_number side)
 Gets active AI for specified side. More...
 

Private Attributes

std::deque< command_history_itemhistory_
 
long history_item_counter_
 
game_info ai_info_
 
events::generic_event map_changed_
 
events::generic_event recruit_list_changed_
 
events::generic_event user_interact_
 
events::generic_event sync_network_
 
events::generic_event tod_changed_
 
events::generic_event gamestate_changed_
 
events::generic_event turn_started_
 
std::chrono::steady_clock::time_point last_interact_
 
int num_interact_
 
AI_map_of_stacks ai_map_
 

Static Private Attributes

static managersingleton_ = nullptr
 

Friends

class ::game_launcher
 

Detailed Description

Class that manages AIs for all sides and manages AI redeployment.

This class is responsible for managing the AI lifecycle.

Definition at line 110 of file manager.hpp.

Member Typedef Documentation

◆ AI_map_of_stacks

typedef std::map< side_number, std::stack< holder > > ai::manager::AI_map_of_stacks
private

Definition at line 419 of file manager.hpp.

Constructor & Destructor Documentation

◆ manager()

ai::manager::manager ( )

Definition at line 333 of file manager.cpp.

References ai::registry::init(), and singleton_.

◆ ~manager()

ai::manager::~manager ( )

Definition at line 351 of file manager.cpp.

References ai_map_, and singleton_.

Member Function Documentation

◆ add_ai_for_side_from_config()

bool ai::manager::add_ai_for_side_from_config ( side_number  side,
const config cfg,
bool  replace = true 
)

Adds active AI for specified side from cfg.

Note
Running this command may invalidate references previously returned by manager. AI is not initialized at this point.
Parameters
sideside number (1-based, as in game_info).
cfgthe config from which all ai parameters are to be read.
replaceshould new ai replace the current ai or 'be placed on top of it'.
Returns
true if successful.

Definition at line 632 of file manager.cpp.

References get_or_create_ai_stack_for_side(), ai::configuration::parse_side_config(), and remove_ai_for_side().

Referenced by add_ai_for_side_from_file(), intf_switch_ai(), and team::team_info::read().

◆ add_ai_for_side_from_file()

bool ai::manager::add_ai_for_side_from_file ( side_number  side,
const std::string &  file,
bool  replace = true 
)

Adds active AI for specified side from file.

Note
Running this command may invalidate references previously returned by manager. AI is not initialized at this point.
Parameters
sideside number (1-based, as in game_info).
filefile name, follows the usual WML convention.
replaceshould new ai replace the current ai or 'be placed on top of it'.
Returns
true if successful.

Definition at line 622 of file manager.cpp.

References add_ai_for_side_from_config(), ERR_AI_MANAGER, and ai::configuration::get_side_config_from_file().

Referenced by internal_evaluate_command(), and team::team_info::read().

◆ add_gamestate_observer()

void ai::manager::add_gamestate_observer ( events::observer event_observer)

◆ add_map_changed_observer()

void ai::manager::add_map_changed_observer ( events::observer event_observer)

Adds an observer of 'ai_map_changed' event.

Definition at line 394 of file manager.cpp.

References events::generic_event::attach_handler(), and map_changed_.

Referenced by ai::keeps_cache::keeps_cache().

◆ add_observer()

void ai::manager::add_observer ( events::observer event_observer)

Adds observer of game events.

Should be called in playsingle_controller 's constructor.

Definition at line 360 of file manager.cpp.

References events::generic_event::attach_handler(), gamestate_changed_, sync_network_, turn_started_, and user_interact_.

◆ add_recruit_list_changed_observer()

void ai::manager::add_recruit_list_changed_observer ( events::observer event_observer)

◆ add_tod_changed_observer()

void ai::manager::add_tod_changed_observer ( events::observer event_observer)

Adds an observer of 'ai_tod_changed' event.

Definition at line 386 of file manager.cpp.

References events::generic_event::attach_handler(), and tod_changed_.

Referenced by ai::aspect::redeploy().

◆ add_turn_started_observer()

void ai::manager::add_turn_started_observer ( events::observer event_observer)

Adds an observer of 'ai_turn_started' event.

Definition at line 404 of file manager.cpp.

References events::generic_event::attach_handler(), and turn_started_.

Referenced by ai::keeps_cache::keeps_cache(), and ai::aspect::redeploy().

◆ append_active_ai_for_side()

void ai::manager::append_active_ai_for_side ( ai::side_number  side,
const config cfg 
)

Appends AI parameters to active AI of the given side.

This function is a backend for [modify_side][ai] tag

Parameters
sideside_number (1-based, as in game_info).
cfg- content of [modify_side][ai] tag

Definition at line 677 of file manager.cpp.

References ai::holder::append_ai(), and get_active_ai_holder_for_side().

Referenced by unit::init(), and intf_append_ai().

◆ clear_ais()

void ai::manager::clear_ais ( )

Clears all the AIs.

Note
Running this command may invalidate references previously returned by manager. For example, this is called from the destructor of playsingle_controller. It is necessary to do this if any of the info structures used by the AI goes out of scope.

Definition at line 667 of file manager.cpp.

References ai_map_.

◆ evaluate_command()

const std::string ai::manager::evaluate_command ( side_number  side,
const std::string &  str 
)

Evaluates a string command using command AI.

Note
Running this command may invalidate references previously returned by manager. Will intercept those commands which start with '!' and '?', and will try to evaluate them as internal commands.
Parameters
sideside number (1-based).
strstring to evaluate.
Returns
string result of evaluation.

Definition at line 472 of file manager.cpp.

References get_active_ai_for_side(), history_, history_item_counter_, internal_evaluate_command(), LOG_AI_MANAGER, MAX_HISTORY_SIZE, raise_gamestate_changed(), and should_intercept().

Referenced by internal_evaluate_command().

◆ get_active_ai_for_side()

ai_composite & ai::manager::get_active_ai_for_side ( side_number  side)
private

Gets active AI for specified side.

Note
Running this command may invalidate references previously returned by manager.
Parameters
sideside number (1-based, as in game_info).
Returns
a reference to the active AI.
Note
This reference may become invalid after specific manager operations.

Definition at line 784 of file manager.cpp.

References get_active_ai_holder_for_side(), and ai::holder::get_ai_ref().

Referenced by evaluate_command(), and play_turn().

◆ get_active_ai_holder_for_side()

holder & ai::manager::get_active_ai_holder_for_side ( side_number  side)
private

◆ get_active_ai_holder_for_side_dbg()

ai::holder & ai::manager::get_active_ai_holder_for_side_dbg ( side_number  side)

Gets the active AI holder for debug purposes.

Will only work in debug mode, otherwise returns a reference to an empty holder

Parameters
sideside number(1-based)
Returns
debug ? active holder : empty holder

Definition at line 697 of file manager.cpp.

References game_config::debug, and get_active_ai_holder_for_side().

Referenced by intf_debug_ai().

◆ get_active_ai_identifier_for_side()

std::string ai::manager::get_active_ai_identifier_for_side ( side_number  side)

Gets AI algorithm identifier for active AI of the given side.

Parameters
sideside number (1-based).
Returns
ai identifier for the active AI

Definition at line 692 of file manager.cpp.

References get_active_ai_holder_for_side(), and ai::holder::get_ai_identifier().

Referenced by play_controller::check_victory(), internal_evaluate_command(), and ai_testing::log_game_start().

◆ get_active_ai_info_for_side()

game_info & ai::manager::get_active_ai_info_for_side ( side_number  side)

Gets AI info for active AI of the given side.

Parameters
sideside number (1-based).
Returns
a reference to active AI info.

Definition at line 712 of file manager.cpp.

References ai_info_.

Referenced by ai::action_result::get_info(), ai::readonly_context_impl::get_info(), and ai::readwrite_context_impl::get_info_w().

◆ get_active_ai_overview_for_side()

std::string ai::manager::get_active_ai_overview_for_side ( side_number  side)

Gets AI Overview for active AI of the given side.

Parameters
sideside number (1-based)
Returns
an ai overview

Definition at line 682 of file manager.cpp.

References get_active_ai_holder_for_side(), and ai::holder::get_ai_overview().

◆ get_active_ai_structure_for_side()

std::string ai::manager::get_active_ai_structure_for_side ( side_number  side)

Gets AI Structure for active AI of the given side.

Parameters
sideside number (1-based)
Returns
an ai structure

Definition at line 687 of file manager.cpp.

References get_active_ai_holder_for_side(), and ai::holder::get_ai_structure().

◆ get_advancement_aspect_for_side()

const ai::unit_advancements_aspect & ai::manager::get_advancement_aspect_for_side ( side_number  side)

◆ get_ai_info()

game_info & ai::manager::get_ai_info ( )

Gets global AI-game info.

Returns
a reference to the AI-game info.

Definition at line 717 of file manager.cpp.

References ai_info_.

Referenced by ai::attack_analysis::attack_close(), and play_turn().

◆ get_or_create_ai_stack_for_side()

std::stack< holder > & ai::manager::get_or_create_ai_stack_for_side ( side_number  side)
private

Gets the AI stack for the specified side, create it if it doesn't exist.

Definition at line 755 of file manager.cpp.

References ai_map_.

Referenced by add_ai_for_side_from_config(), get_active_ai_holder_for_side(), remove_ai_for_side(), and remove_all_ais_for_side().

◆ get_singleton()

static manager& ai::manager::get_singleton ( )
inlinestatic

Definition at line 140 of file manager.hpp.

References singleton_.

Referenced by team::add_recruit(), ai::attack_analysis::attack_close(), play_controller::check_victory(), events::menu_handler::do_ai_formula(), ai::ai_default_rca::aspect_attacks_base::do_attack_analysis(), ai::attack_result::do_execute(), ai::move_result::do_execute(), ai::recall_result::do_execute(), ai::recruit_result::do_execute(), ai::stopunit_result::do_execute(), ai::synced_command_result::do_execute(), ai::gamestate_observer::gamestate_observer(), ai::action_result::get_info(), ai::readonly_context_impl::get_info(), ai::readwrite_context_impl::get_info_w(), unit::init(), intf_append_ai(), intf_debug_ai(), intf_handle_user_interact(), intf_modify_ai(), intf_modify_ai_old(), intf_switch_ai(), ai::keeps_cache::keeps_cache(), ai_testing::log_game_start(), playsingle_controller::play_ai_turn(), ai::readwrite_context_impl::raise_gamestate_changed(), ai::readonly_context_impl::raise_user_interact(), team::team_info::read(), ai::readonly_context_impl::readonly_context_impl(), ai::default_recruitment::recruitment::recruit_situation_change_observer::recruit_situation_change_observer(), ai::aspect::redeploy(), ai::ai_default_rca::candidate_action_evaluation_loop::remove_completed_cas(), ai::ai_default_rca::move_leader_to_goals_phase::remove_goal(), team::set_recruits(), gui2::dialogs::team_mode_controller::show_ai(), gui2::dialogs::team_mode_controller::show_ai_components(), gui2::dialogs::team_mode_controller::show_ai_tree(), game_events::WML_HANDLER_FUNCTION(), team::team_info::write(), ai::aspect::~aspect(), ai::gamestate_observer::~gamestate_observer(), ai::keeps_cache::~keeps_cache(), ai::readonly_context_impl::~readonly_context_impl(), and ai::default_recruitment::recruitment::recruit_situation_change_observer::~recruit_situation_change_observer().

◆ has_manager()

static bool ai::manager::has_manager ( )
inlinestatic

Definition at line 146 of file manager.hpp.

References singleton_.

Referenced by team::team_info::read(), and team::set_recruits().

◆ internal_evaluate_command()

const std::string ai::manager::internal_evaluate_command ( side_number  side,
const std::string &  str 
)
private

Evaluates an internal manager command.

Parameters
sideside number (1-based).
strstring to evaluate.
Returns
string result of evaluation. TODO: rewrite this function to use a fai or lua parser.

Definition at line 511 of file manager.cpp.

References add_ai_for_side_from_file(), evaluate_command(), get_active_ai_identifier_for_side(), history_, history_item_counter_, n, utils::parenthetical_split(), remove_ai_for_side(), and utils::stoi().

Referenced by evaluate_command().

◆ modify_active_ai_for_side()

void ai::manager::modify_active_ai_for_side ( ai::side_number  side,
const config cfg 
)

Modifies AI parameters for active AI of the given side.

This function is a backend for [modify_ai] tag

Parameters
sideside_number (1-based, as in game_info).
cfg- content of [modify_ai] tag

Definition at line 672 of file manager.cpp.

References get_active_ai_holder_for_side(), and ai::holder::modify_ai().

Referenced by intf_modify_ai(), intf_modify_ai_old(), ai::ai_default_rca::candidate_action_evaluation_loop::remove_completed_cas(), and ai::ai_default_rca::move_leader_to_goals_phase::remove_goal().

◆ play_turn()

void ai::manager::play_turn ( side_number  side)

◆ raise_gamestate_changed()

void ai::manager::raise_gamestate_changed ( )

◆ raise_map_changed()

void ai::manager::raise_map_changed ( )

Notifies all observers of 'ai_map_changed' event.

Definition at line 464 of file manager.cpp.

References map_changed_, and events::generic_event::notify_observers().

◆ raise_recruit_list_changed()

void ai::manager::raise_recruit_list_changed ( )

Notifies all observers of 'ai_recruit_list_changed' event.

Definition at line 460 of file manager.cpp.

References events::generic_event::notify_observers(), and recruit_list_changed_.

Referenced by team::add_recruit(), and team::set_recruits().

◆ raise_sync_network()

void ai::manager::raise_sync_network ( )

Notifies all observers of 'ai_sync_network' event.

Basically a request from the AI to sync the network.

Definition at line 444 of file manager.cpp.

References events::generic_event::notify_observers(), and sync_network_.

◆ raise_tod_changed()

void ai::manager::raise_tod_changed ( )

Notifies all observers of 'ai_tod_changed' event.

Definition at line 452 of file manager.cpp.

References events::generic_event::notify_observers(), and tod_changed_.

Referenced by play_turn().

◆ raise_turn_started()

void ai::manager::raise_turn_started ( )

Notifies all observers of 'ai_turn_started' event.

Definition at line 456 of file manager.cpp.

References events::generic_event::notify_observers(), and turn_started_.

Referenced by play_turn().

◆ raise_user_interact()

void ai::manager::raise_user_interact ( )

Notifies all observers of 'ai_user_interact' event.

Function which should be called frequently to allow the user to interact with the interface. This function will make sure that interaction doesn't occur too often, so there is no problem with calling it very regularly.

Definition at line 424 of file manager.cpp.

References last_interact_, events::generic_event::notify_observers(), num_interact_, resources::simulation_, and user_interact_.

Referenced by ai::ai_default_rca::aspect_attacks_base::do_attack_analysis(), intf_handle_user_interact(), and ai::readonly_context_impl::raise_user_interact().

◆ remove_ai_for_side()

void ai::manager::remove_ai_for_side ( side_number  side)

Removes top-level AI from side.

Note
Running this command may invalidate references previously returned by manager.
Parameters
sideside number (1-based, as in game_info).

Definition at line 649 of file manager.cpp.

References get_or_create_ai_stack_for_side().

Referenced by add_ai_for_side_from_config(), and internal_evaluate_command().

◆ remove_all_ais_for_side()

void ai::manager::remove_all_ais_for_side ( side_number  side)

Removes all AIs from side.

Note
Running this command may invalidate references previously returned by manager.
Parameters
sideside number (1-based, as in game_info).

Definition at line 657 of file manager.cpp.

References get_or_create_ai_stack_for_side().

◆ remove_gamestate_observer()

void ai::manager::remove_gamestate_observer ( events::observer event_observer)

◆ remove_map_changed_observer()

void ai::manager::remove_map_changed_observer ( events::observer event_observer)

Deletes an observer of 'ai_map_changed' event.

Definition at line 414 of file manager.cpp.

References events::generic_event::detach_handler(), and map_changed_.

Referenced by ai::keeps_cache::~keeps_cache().

◆ remove_observer()

void ai::manager::remove_observer ( events::observer event_observer)

Removes an observer of game events.

Should be called in playsingle_controller 's destructor.

Definition at line 367 of file manager.cpp.

References events::generic_event::detach_handler(), gamestate_changed_, sync_network_, turn_started_, and user_interact_.

◆ remove_recruit_list_changed_observer()

void ai::manager::remove_recruit_list_changed_observer ( events::observer event_observer)

Deletes an observer of 'ai_recruit_list_changed' event.

Definition at line 409 of file manager.cpp.

References events::generic_event::detach_handler(), and recruit_list_changed_.

Referenced by ai::default_recruitment::recruitment::recruit_situation_change_observer::~recruit_situation_change_observer().

◆ remove_tod_changed_observer()

void ai::manager::remove_tod_changed_observer ( events::observer event_observer)

Deletes an observer of 'ai_tod_changed' event.

Definition at line 390 of file manager.cpp.

References events::generic_event::detach_handler(), and tod_changed_.

Referenced by ai::aspect::redeploy(), and ai::aspect::~aspect().

◆ remove_turn_started_observer()

void ai::manager::remove_turn_started_observer ( events::observer event_observer)

Deletes an observer of 'ai_turn_started' event.

Definition at line 419 of file manager.cpp.

References events::generic_event::detach_handler(), and turn_started_.

Referenced by ai::aspect::redeploy(), ai::aspect::~aspect(), and ai::keeps_cache::~keeps_cache().

◆ should_intercept()

bool ai::manager::should_intercept ( const std::string &  str) const
private

Determines if the command should be intercepted and evaluated as internal command.

Parameters
strcommand string to check.
Returns
true if the command should be intercepted and evaluated.

Definition at line 492 of file manager.cpp.

Referenced by evaluate_command().

◆ to_config()

config ai::manager::to_config ( side_number  side)

Gets AI config for active AI of the given side.

Parameters
sideside number (1-based).
Returns
a config object for the active AI

Definition at line 707 of file manager.cpp.

References get_active_ai_holder_for_side(), and ai::holder::to_config().

Friends And Related Function Documentation

◆ ::game_launcher

friend class ::game_launcher
friend

Definition at line 491 of file manager.hpp.

Member Data Documentation

◆ ai_info_

game_info ai::manager::ai_info_
private

Definition at line 423 of file manager.hpp.

Referenced by get_active_ai_info_for_side(), and get_ai_info().

◆ ai_map_

AI_map_of_stacks ai::manager::ai_map_
private

Definition at line 435 of file manager.hpp.

Referenced by clear_ais(), get_or_create_ai_stack_for_side(), and ~manager().

◆ AI_TYPE_AI2

const std::string ai::manager::AI_TYPE_AI2
static

Definition at line 125 of file manager.hpp.

◆ AI_TYPE_COMPOSITE_AI

const std::string ai::manager::AI_TYPE_COMPOSITE_AI = "composite_ai"
static

Definition at line 120 of file manager.hpp.

◆ AI_TYPE_DEFAULT

const std::string ai::manager::AI_TYPE_DEFAULT = "default"
static

Definition at line 126 of file manager.hpp.

◆ AI_TYPE_DFOOL_AI

const std::string ai::manager::AI_TYPE_DFOOL_AI
static

Definition at line 124 of file manager.hpp.

◆ AI_TYPE_FORMULA_AI

const std::string ai::manager::AI_TYPE_FORMULA_AI = "formula_ai"
static

Definition at line 123 of file manager.hpp.

◆ AI_TYPE_IDLE_AI

const std::string ai::manager::AI_TYPE_IDLE_AI = "idle_ai"
static

Definition at line 122 of file manager.hpp.

◆ AI_TYPE_SAMPLE_AI

const std::string ai::manager::AI_TYPE_SAMPLE_AI = "sample_ai"
static

Definition at line 121 of file manager.hpp.

◆ gamestate_changed_

events::generic_event ai::manager::gamestate_changed_
private

◆ history_

std::deque< command_history_item > ai::manager::history_
private

Definition at line 421 of file manager.hpp.

Referenced by evaluate_command(), and internal_evaluate_command().

◆ history_item_counter_

long ai::manager::history_item_counter_
private

Definition at line 422 of file manager.hpp.

Referenced by evaluate_command(), and internal_evaluate_command().

◆ last_interact_

std::chrono::steady_clock::time_point ai::manager::last_interact_
private

Definition at line 432 of file manager.hpp.

Referenced by play_turn(), and raise_user_interact().

◆ map_changed_

events::generic_event ai::manager::map_changed_
private

◆ MAX_HISTORY_SIZE

const std::size_t ai::manager::MAX_HISTORY_SIZE = 200
static

Definition at line 118 of file manager.hpp.

Referenced by evaluate_command().

◆ num_interact_

int ai::manager::num_interact_
private

Definition at line 433 of file manager.hpp.

Referenced by play_turn(), and raise_user_interact().

◆ recruit_list_changed_

events::generic_event ai::manager::recruit_list_changed_
private

◆ singleton_

manager * ai::manager::singleton_ = nullptr
staticprivate

◆ sync_network_

events::generic_event ai::manager::sync_network_
private

Definition at line 428 of file manager.hpp.

Referenced by add_observer(), raise_sync_network(), and remove_observer().

◆ tod_changed_

events::generic_event ai::manager::tod_changed_
private

◆ turn_started_

events::generic_event ai::manager::turn_started_
private

◆ user_interact_

events::generic_event ai::manager::user_interact_
private

Definition at line 427 of file manager.hpp.

Referenced by add_observer(), raise_user_interact(), and remove_observer().


The documentation for this class was generated from the following files: