40 virtual bool is_ok()
const;
68 virtual std::string
evaluate(
const std::string& str);
112 if (engine_factories==
nullptr) {
115 return *engine_factories;
127 get_list().emplace(name,ptr_to_this);
133 template<
class ENGINE>
152 cfg[
"engine"] =
"cpp";
153 return std::make_shared<ENGINE>(
ai, cfg);
virtual engine_ptr get_new_instance(readonly_context &ai, const std::string &name)=0
virtual engine_ptr get_new_instance(readonly_context &ai, const config &cfg)=0
engine_factory(const std::string &name)
static factory_map & get_list()
virtual ~engine_factory()
std::map< std::string, factory_ptr > factory_map
std::pair< const std::string, factory_ptr > factory_map_pair
std::shared_ptr< engine_factory > factory_ptr
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 std::string get_id() const
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 std::string get_engine() const
virtual void do_parse_goal_from_config(const config &cfg, std::back_insert_iterator< std::vector< goal_ptr >> b)
virtual engine_ptr get_new_instance(readonly_context &ai, const std::string &name)
register_engine_factory(const std::string &name)
virtual engine_ptr get_new_instance(readonly_context &ai, const config &cfg)
A config object defines a single node in a WML file, with access to child nodes.
A component of the AI framework.
Helper functions for the object which operates in the context of AI for specific side this is part of...
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