33 #define DBG_AI_STAGE LOG_STREAM(debug, log_ai_stage)
34 #define LOG_AI_STAGE LOG_STREAM(info, log_ai_stage)
35 #define ERR_AI_STAGE LOG_STREAM(err, log_ai_stage)
42 : recursion_counter_(context.get_recursion_count()), cfg_(cfg)
69 cfg[
"engine"] =
cfg_[
"engine"];
70 cfg[
"name"] =
cfg_[
"name"];
71 cfg[
"id"] =
cfg_[
"id"];
82 return cfg_[
"engine"];
117 ERR_AI_STAGE <<
"Error: Attempt to double-register stage " << name << std::endl;
virtual side_number get_side() const
Get the side number.
::tod_manager * tod_manager
virtual bool do_play_stage()
Play the turn - implementation.
idle_stage(ai_context &context, const config &cfg)
int get_recursion_count() const
get the value of the recursion counter
bool play_stage()
Play the turn - strategy.
recursion_counter recursion_counter_
virtual std::string get_id() const
AI Support engine - creating specific ai components from config.
virtual std::string get_name() const
virtual ~stage()
Destructor.
A small explanation about what's going on here: Each action has access to two game_info objects First...
static factory_map & get_list()
virtual config to_config() const
serialize
bool is_duplicate(const std::string &name)
Composite AI with turn sequence which is a vector of stages.
virtual void on_create()
Initialization.
static lg::log_domain log_ai_stage("ai/stage")
void init_ai_context_proxy(ai_context &target)
int get_count() const
Get the current value of the recursion counter.
stage(ai_context &context, const config &cfg)
Constructor.
virtual bool do_play_stage()=0
Play the turn - implementation.
Helper functions for the object which operates in the context of AI for specific side this is part of...
GLuint const GLchar * name
bool find(E event, F functor)
Tests whether an event handler is available.
Standard logging facilities (interface).
virtual std::string get_engine() const
A config object defines a single node in a WML file, with access to child nodes.
GLsizei const GLcharARB ** string