28 #define DBG_AI_ENGINE LOG_STREAM(debug, log_ai_engine)
29 #define LOG_AI_ENGINE LOG_STREAM(info, log_ai_engine)
30 #define ERR_AI_ENGINE LOG_STREAM(err, log_ai_engine)
34 , ai_context_(nullptr)
35 , engine_(cfg[
"engine"])
56 eng->do_parse_aspect_from_config(cfg,
id,
b);
65 eng->do_parse_candidate_action_from_config(context, cfg,
b);
74 eng->do_parse_engine_from_config(cfg,
b);
84 eng->do_parse_goal_from_config(cfg,
b);
94 eng->do_parse_stage_from_config(context, cfg,
b);
125 return "evaluate command is not implemented by this engine";
155 ERR_AI_ENGINE <<
"Error: Attempt to double-register engine " << name << std::endl;
virtual std::string evaluate(const std::string &str)
virtual std::string get_name() const
virtual void set_ai_context(ai_context_ptr context)
set ai context (which is not available during early initialization)
static void parse_engine_from_config(readonly_context &context, const config &cfg, std::back_insert_iterator< std::vector< engine_ptr > > b)
engine(readonly_context &context, const config &cfg)
AI Support engine - creating specific ai components from config.
virtual void do_parse_stage_from_config(ai_context &context, const config &cfg, std::back_insert_iterator< std::vector< stage_ptr > > b)
GLdouble GLdouble GLdouble b
A small explanation about what's going on here: Each action has access to two game_info objects First...
virtual config to_config() const
serialize
static factory_map & get_list()
std::string engine_
name of the engine which has created this engine
virtual void do_parse_engine_from_config(const config &cfg, std::back_insert_iterator< std::vector< engine_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 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 void do_parse_goal_from_config(const config &cfg, std::back_insert_iterator< std::vector< goal_ptr > > b)
bool is_duplicate(const std::string &name)
static lg::log_domain log_ai_engine("ai/engine")
static void parse_stage_from_config(ai_context &context, const config &cfg, std::back_insert_iterator< std::vector< stage_ptr > > b)
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)
virtual bool is_ok() const
GLuint const GLchar * name
virtual void do_parse_candidate_action_from_config(rca_context &context, const config &cfg, std::back_insert_iterator< std::vector< candidate_action_ptr > > b)
ai_context_ptr ai_context_
virtual ai_context_ptr get_ai_context()
bool find(E event, F functor)
Tests whether an event handler is available.
readonly_context & get_readonly_context()
Standard logging facilities (interface).
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.
static void parse_goal_from_config(readonly_context &context, const config &cfg, std::back_insert_iterator< std::vector< goal_ptr > > b)
GLsizei const GLcharARB ** string
virtual void do_parse_aspect_from_config(const config &cfg, const std::string &id, std::back_insert_iterator< std::vector< aspect_ptr > > b)