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

#include <goal.hpp>

Inheritance diagram for ai::goal_factory:

Public Types

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

Public Member Functions

virtual goal_ptr get_new_instance (readonly_context &context, const config &cfg)=0
 
 goal_factory (const std::string &name)
 
virtual ~goal_factory ()
 

Static Public Member Functions

static factory_mapget_list ()
 

Private Member Functions

bool is_duplicate (const std::string &name)
 

Detailed Description

Definition at line 151 of file goal.hpp.

Member Typedef Documentation

◆ factory_map

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

Definition at line 155 of file goal.hpp.

◆ factory_map_pair

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

Definition at line 156 of file goal.hpp.

◆ factory_ptr

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

Definition at line 154 of file goal.hpp.

Constructor & Destructor Documentation

◆ goal_factory()

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

Definition at line 168 of file goal.hpp.

References get_list(), and is_duplicate().

◆ ~goal_factory()

virtual ai::goal_factory::~goal_factory ( )
inlinevirtual

Definition at line 177 of file goal.hpp.

Member Function Documentation

◆ get_list()

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

◆ get_new_instance()

virtual goal_ptr ai::goal_factory::get_new_instance ( readonly_context context,
const config cfg 
)
pure virtual

◆ is_duplicate()

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

Definition at line 326 of file goal.cpp.

References ERR_AI_GOAL, utils::find(), and get_list().

Referenced by goal_factory().


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