21 #ifndef AI_COMPOSITE_ENGINE_HPP_INCLUDED
22 #define AI_COMPOSITE_ENGINE_HPP_INCLUDED
45 virtual bool is_ok()
const;
126 static factory_map *engine_factories;
127 if (engine_factories==
nullptr) {
130 return *engine_factories;
141 factory_ptr ptr_to_this(
this);
142 get_list().insert(make_pair(name,ptr_to_this));
149 template<
class ENGINE>
168 cfg[
"engine"] =
"cpp";
boost::shared_ptr< engine > engine_ptr
std::pair< const std::string, factory_ptr > factory_map_pair
virtual std::string evaluate(const std::string &str)
boost::shared_ptr< engine_factory > factory_ptr
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)
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
std::map< std::string, factory_ptr > factory_map
A small explanation about what's going on here: Each action has access to two game_info objects First...
virtual std::string get_engine() const
virtual config to_config() const
serialize
A component of the AI framework.
static factory_map & get_list()
std::string engine_
name of the engine which has created this engine
virtual std::string get_id() const
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_factory()
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 config &cfg)
bool is_duplicate(const std::string &name)
static void parse_stage_from_config(ai_context &context, const config &cfg, std::back_insert_iterator< std::vector< stage_ptr > > b)
engine_factory(const std::string &name)
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 engine_ptr get_new_instance(readonly_context &ai, const config &cfg)=0
virtual bool is_ok() const
Helper functions for the object which operates in the context of AI for specific side this is part of...
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)
virtual engine_ptr get_new_instance(readonly_context &ai, const std::string &name)
register_engine_factory(const std::string &name)
ai_context_ptr ai_context_
virtual ai_context_ptr get_ai_context()
readonly_context & get_readonly_context()
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)