The Battle for Wesnoth  1.13.10+dev
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
Public Member Functions | Static Public Member Functions | Protected Attributes | List of all members
ai::engine Class Reference

#include <engine.hpp>

Inheritance diagram for ai::engine:
Inheritance graph

Public Member Functions

 engine (readonly_context &context, const config &cfg)
 
virtual ~engine ()
 
virtual bool is_ok () const
 
virtual void do_parse_aspect_from_config (const config &cfg, const std::string &id, std::back_insert_iterator< std::vector< aspect_ptr > > b)
 
virtual void do_parse_candidate_action_from_config (rca_context &context, const config &cfg, std::back_insert_iterator< std::vector< candidate_action_ptr > > b)
 
virtual void do_parse_goal_from_config (const config &cfg, std::back_insert_iterator< std::vector< goal_ptr > > b)
 
virtual void do_parse_engine_from_config (const config &cfg, std::back_insert_iterator< std::vector< engine_ptr > > b)
 
virtual void do_parse_stage_from_config (ai_context &context, const config &cfg, std::back_insert_iterator< std::vector< stage_ptr > > b)
 
virtual std::string evaluate (const std::string &str)
 
readonly_contextget_readonly_context ()
 
virtual void set_ai_context (ai_context_ptr context)
 set ai context (which is not available during early initialization) More...
 
virtual ai_context_ptr get_ai_context ()
 
virtual config to_config () const
 serialize More...
 
virtual std::string get_id () const
 
virtual std::string get_engine () const
 
virtual std::string get_name () const
 
- Public Member Functions inherited from ai::component
 component ()
 
virtual ~component ()
 
virtual componentget_child (const path_element &child)
 
virtual std::vector< component * > get_children (const std::string &type)
 
virtual std::vector< std::string > get_children_types ()
 
virtual bool change_child (const path_element &child, const config &cfg)
 
virtual bool add_child (const path_element &child, const config &cfg)
 
virtual bool delete_child (const path_element &child)
 
property_handler_mapproperty_handlers ()
 

Static Public Member Functions

static void parse_aspect_from_config (readonly_context &context, const config &cfg, const std::string &id, std::back_insert_iterator< std::vector< aspect_ptr > > b)
 
static void parse_goal_from_config (readonly_context &context, const config &cfg, std::back_insert_iterator< std::vector< goal_ptr > > b)
 
static void parse_candidate_action_from_config (rca_context &context, const config &cfg, std::back_insert_iterator< std::vector< candidate_action_ptr > > b)
 
static void parse_engine_from_config (readonly_context &context, const config &cfg, std::back_insert_iterator< std::vector< engine_ptr > > b)
 
static void parse_stage_from_config (ai_context &context, const config &cfg, std::back_insert_iterator< std::vector< stage_ptr > > b)
 

Protected Attributes

readonly_contextai_
 
ai_context_ptr ai_context_
 
std::string engine_
 name of the engine which has created this engine More...
 
std::string id_
 
std::string name_
 

Detailed Description

Definition at line 37 of file engine.hpp.

Constructor & Destructor Documentation

ai::engine::engine ( readonly_context context,
const config cfg 
)

Definition at line 32 of file engine.cpp.

References ai_, ai::side_context::get_side(), LOG_AI_ENGINE, and name_.

ai::engine::~engine ( )
virtual

Definition at line 42 of file engine.cpp.

Member Function Documentation

void ai::engine::do_parse_aspect_from_config ( const config cfg,
const std::string &  id,
std::back_insert_iterator< std::vector< aspect_ptr > >  b 
)
virtual

Reimplemented in ai::engine_lua, and ai::engine_cpp.

Definition at line 98 of file engine.cpp.

void ai::engine::do_parse_candidate_action_from_config ( rca_context context,
const config cfg,
std::back_insert_iterator< std::vector< candidate_action_ptr > >  b 
)
virtual

Reimplemented in ai::engine_lua, ai::engine_cpp, and ai::engine_fai.

Definition at line 104 of file engine.cpp.

void ai::engine::do_parse_engine_from_config ( const config cfg,
std::back_insert_iterator< std::vector< engine_ptr > >  b 
)
virtual

Reimplemented in ai::engine_cpp.

Definition at line 108 of file engine.cpp.

void ai::engine::do_parse_goal_from_config ( const config cfg,
std::back_insert_iterator< std::vector< goal_ptr > >  b 
)
virtual

Reimplemented in ai::engine_lua, and ai::engine_cpp.

Definition at line 113 of file engine.cpp.

void ai::engine::do_parse_stage_from_config ( ai_context context,
const config cfg,
std::back_insert_iterator< std::vector< stage_ptr > >  b 
)
virtual

Reimplemented in ai::engine_lua, ai::engine_cpp, and ai::engine_fai.

Definition at line 118 of file engine.cpp.

std::string ai::engine::evaluate ( const std::string &  str)
virtual

Reimplemented in ai::engine_lua, and ai::engine_fai.

Definition at line 123 of file engine.cpp.

ai_context_ptr ai::engine::get_ai_context ( )
virtual

Definition at line 133 of file engine.cpp.

References ai_context_.

Referenced by ai::cfun_ai_get_targets().

virtual std::string ai::engine::get_engine ( ) const
inlinevirtual

Implements ai::component.

Definition at line 98 of file engine.hpp.

References engine_.

virtual std::string ai::engine::get_id ( ) const
inlinevirtual

Implements ai::component.

Definition at line 95 of file engine.hpp.

References id_.

Referenced by ai::engine_lua::to_config().

virtual std::string ai::engine::get_name ( ) const
inlinevirtual

Implements ai::component.

Definition at line 101 of file engine.hpp.

References name_.

Referenced by to_config().

readonly_context & ai::engine::get_readonly_context ( )
bool ai::engine::is_ok ( ) const
virtual

Reimplemented in ai::engine_lua.

Definition at line 46 of file engine.cpp.

void ai::engine::parse_aspect_from_config ( readonly_context context,
const config cfg,
const std::string &  id,
std::back_insert_iterator< std::vector< aspect_ptr > >  b 
)
static
void ai::engine::parse_candidate_action_from_config ( rca_context context,
const config cfg,
std::back_insert_iterator< std::vector< candidate_action_ptr > >  b 
)
static
void ai::engine::parse_engine_from_config ( readonly_context context,
const config cfg,
std::back_insert_iterator< std::vector< engine_ptr > >  b 
)
static
void ai::engine::parse_goal_from_config ( readonly_context context,
const config cfg,
std::back_insert_iterator< std::vector< goal_ptr > >  b 
)
static
void ai::engine::parse_stage_from_config ( ai_context context,
const config cfg,
std::back_insert_iterator< std::vector< stage_ptr > >  b 
)
static

Definition at line 89 of file engine.cpp.

References b, and ai::readonly_context::get_engine_by_cfg().

Referenced by ai::ai_composite::create_stage().

void ai::engine::set_ai_context ( ai_context_ptr  context)
virtual

set ai context (which is not available during early initialization)

Definition at line 128 of file engine.cpp.

References ai_context_.

config ai::engine::to_config ( ) const
virtual

serialize

Reimplemented in ai::engine_lua, and ai::engine_fai.

Definition at line 138 of file engine.cpp.

References engine_, and get_name().

Referenced by ai::engine_fai::to_config(), and ai::engine_lua::to_config().

Member Data Documentation

readonly_context& ai::engine::ai_
protected
ai_context_ptr ai::engine::ai_context_
protected

Definition at line 106 of file engine.hpp.

Referenced by get_ai_context(), and set_ai_context().

std::string ai::engine::engine_
protected

name of the engine which has created this engine

Definition at line 109 of file engine.hpp.

Referenced by get_engine(), and to_config().

std::string ai::engine::id_
protected

Definition at line 110 of file engine.hpp.

Referenced by get_id().

std::string ai::engine::name_
protected

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