The Battle for Wesnoth  1.19.5+dev
Public Types | Public Member Functions | Static Public Member Functions | Private Member Functions | List of all members
ai::engine_factory Class Referenceabstract

#include <engine.hpp>

Inheritance diagram for ai::engine_factory:

Public Types

typedef std::shared_ptr< engine_factoryfactory_ptr
 
typedef std::map< std::string, factory_ptrfactory_map
 
typedef std::pair< const std::string, factory_ptrfactory_map_pair
 

Public Member Functions

virtual engine_ptr get_new_instance (readonly_context &ai, const config &cfg)=0
 
virtual engine_ptr get_new_instance (readonly_context &ai, const std::string &name)=0
 
 engine_factory (const std::string &name)
 
virtual ~engine_factory ()
 

Static Public Member Functions

static factory_mapget_list ()
 

Private Member Functions

bool is_duplicate (const std::string &name)
 

Detailed Description

Definition at line 103 of file engine.hpp.

Member Typedef Documentation

◆ factory_map

typedef std::map<std::string, factory_ptr> ai::engine_factory::factory_map

Definition at line 107 of file engine.hpp.

◆ factory_map_pair

typedef std::pair<const std::string, factory_ptr> ai::engine_factory::factory_map_pair

Definition at line 108 of file engine.hpp.

◆ factory_ptr

typedef std::shared_ptr< engine_factory > ai::engine_factory::factory_ptr

Definition at line 106 of file engine.hpp.

Constructor & Destructor Documentation

◆ engine_factory()

ai::engine_factory::engine_factory ( const std::string &  name)
inline

Definition at line 121 of file engine.hpp.

References get_list(), and is_duplicate().

◆ ~engine_factory()

virtual ai::engine_factory::~engine_factory ( )
inlinevirtual

Definition at line 130 of file engine.hpp.

Member Function Documentation

◆ get_list()

static factory_map& ai::engine_factory::get_list ( )
inlinestatic

◆ get_new_instance() [1/2]

virtual engine_ptr ai::engine_factory::get_new_instance ( readonly_context ai,
const config cfg 
)
pure virtual

◆ get_new_instance() [2/2]

virtual engine_ptr ai::engine_factory::get_new_instance ( readonly_context ai,
const std::string &  name 
)
pure virtual

◆ is_duplicate()

bool ai::engine_factory::is_duplicate ( const std::string &  name)
private

Definition at line 148 of file engine.cpp.

References ERR_AI_ENGINE, and get_list().

Referenced by engine_factory().


The documentation for this class was generated from the following files: