64 virtual std::string
get_id()
const;
65 virtual std::string
get_name()
const;
91 bool is_duplicate(
const std::string &name);
98 static factory_map *stage_factories;
99 if (stage_factories==
nullptr) {
100 stage_factories =
new factory_map;
102 return *stage_factories;
109 if (is_duplicate(name)) {
112 factory_ptr ptr_to_this(
this);
113 get_list().emplace(name,ptr_to_this);
119 template<
class STAGE>
128 stage_ptr a = std::make_shared<STAGE>(context, cfg);
virtual std::string get_name() const
std::shared_ptr< stage > stage_ptr
virtual std::string get_engine() const
std::map< std::string, factory_ptr > factory_map
stage_factory(const std::string &name)
bool play_stage()
Play the turn - strategy.
std::pair< const std::string, factory_ptr > factory_map_pair
recursion_counter recursion_counter_
virtual std::string get_id() 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()
A component of the AI framework.
virtual void on_create()
Initialization.
stage(ai_context &context, const config &cfg)
Constructor.
std::shared_ptr< stage_factory > factory_ptr
virtual config to_config() const
serialize
virtual bool do_play_stage()=0
Play the turn - implementation.
register_stage_factory(const std::string &name)
A config object defines a single node in a WML file, with access to child nodes.
int get_recursion_count() const
get the value of the recursion counter
virtual stage_ptr get_new_instance(ai_context &context, const config &cfg)