29 #define DBG_AI_ENGINE LOG_STREAM(debug, log_ai_engine)
30 #define LOG_AI_ENGINE LOG_STREAM(info, log_ai_engine)
31 #define ERR_AI_ENGINE LOG_STREAM(err, log_ai_engine)
35 , ai_context_(nullptr)
36 , engine_(cfg[
"engine"])
57 eng->do_parse_aspect_from_config(cfg,
id,
b);
66 eng->do_parse_candidate_action_from_config(context, cfg,
b);
75 eng->do_parse_engine_from_config(cfg,
b);
84 eng->do_parse_goal_from_config(cfg,
b);
93 eng->do_parse_stage_from_config(context, cfg,
b);
121 return "evaluate command is not implemented by this engine";
151 ERR_AI_ENGINE <<
"Error: Attempt to double-register engine " << name;
static factory_map & get_list()
bool is_duplicate(const std::string &name)
std::string engine_
name of the engine which has created this engine
virtual ai_context_ptr get_ai_context()
engine(readonly_context &context, const config &cfg)
static void parse_goal_from_config(readonly_context &context, const config &cfg, std::back_insert_iterator< std::vector< goal_ptr >> b)
virtual void set_ai_context(ai_context_ptr context)
set ai context (which is not available during early initialization)
virtual config to_config() const
serialize
virtual std::string get_name() const
virtual std::string evaluate(const std::string &str)
static void parse_aspect_from_config(readonly_context &context, const config &cfg, const std::string &id, std::back_insert_iterator< std::vector< aspect_ptr >> b)
ai_context_ptr ai_context_
virtual void do_parse_aspect_from_config(const config &cfg, const std::string &id, std::back_insert_iterator< std::vector< aspect_ptr >> b)
virtual void do_parse_engine_from_config(const config &cfg, std::back_insert_iterator< std::vector< engine_ptr >> b)
virtual void do_parse_candidate_action_from_config(rca_context &context, const config &cfg, std::back_insert_iterator< std::vector< candidate_action_ptr >> b)
static void parse_candidate_action_from_config(rca_context &context, const config &cfg, std::back_insert_iterator< std::vector< candidate_action_ptr >> b)
virtual void do_parse_stage_from_config(ai_context &context, const config &cfg, std::back_insert_iterator< std::vector< stage_ptr >> b)
static void parse_stage_from_config(ai_context &context, const config &cfg, std::back_insert_iterator< std::vector< stage_ptr >> b)
static void parse_engine_from_config(readonly_context &context, const config &cfg, std::back_insert_iterator< std::vector< engine_ptr >> b)
virtual bool is_ok() const
readonly_context & get_readonly_context()
virtual void do_parse_goal_from_config(const config &cfg, std::back_insert_iterator< std::vector< goal_ptr >> b)
virtual engine_ptr get_engine_by_cfg(const config &cfg)=0
get engine by cfg, creating it if it is not created yet but known
virtual side_number get_side() const =0
Get the side number.
A config object defines a single node in a WML file, with access to child nodes.
AI Support engine - creating specific ai components from config.
Standard logging facilities (interface).
A small explanation about what's going on here: Each action has access to two game_info objects First...
std::shared_ptr< engine > engine_ptr
static lg::log_domain log_ai_engine("ai/engine")
auto * find(Container &container, const Value &value)
Convenience wrapper for using find on a container without needing to comare to end()