66 virtual std::string
get_id()
const;
67 virtual std::string
get_name()
const;
95 bool is_duplicate(
const std::string &
name);
102 static factory_map *stage_factories;
103 if (stage_factories==
nullptr) {
104 stage_factories =
new factory_map;
106 return *stage_factories;
113 if (is_duplicate(name)) {
116 factory_ptr ptr_to_this(
this);
117 get_list().emplace(name,ptr_to_this);
124 template<
class STAGE>
133 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.
static const char * name(const std::vector< SDL_Joystick *> &joysticks, const std::size_t index)
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)