The Battle for Wesnoth  1.19.7+dev
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:

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 34 of file engine.hpp.

Constructor & Destructor Documentation

◆ engine()

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

Definition at line 33 of file engine.cpp.

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

◆ ~engine()

ai::engine::~engine ( )
virtual

Definition at line 43 of file engine.cpp.

Member Function Documentation

◆ do_parse_aspect_from_config()

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_cpp.

Definition at line 97 of file engine.cpp.

◆ do_parse_candidate_action_from_config()

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_fai, and ai::engine_cpp.

Definition at line 102 of file engine.cpp.

◆ do_parse_engine_from_config()

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 106 of file engine.cpp.

◆ do_parse_goal_from_config()

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_cpp.

Definition at line 110 of file engine.cpp.

◆ do_parse_stage_from_config()

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_fai, and ai::engine_cpp.

Definition at line 114 of file engine.cpp.

◆ evaluate()

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

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

Definition at line 119 of file engine.cpp.

◆ get_ai_context()

ai_context_ptr ai::engine::get_ai_context ( )
virtual

Definition at line 129 of file engine.cpp.

References ai_context_.

Referenced by ai::cfun_ai_get_targets().

◆ get_engine()

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

Implements ai::component.

Definition at line 86 of file engine.hpp.

References engine_.

◆ get_id()

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

Implements ai::component.

Definition at line 83 of file engine.hpp.

References id_.

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

◆ get_name()

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

Implements ai::component.

Definition at line 89 of file engine.hpp.

References name_.

Referenced by to_config().

◆ get_readonly_context()

readonly_context & ai::engine::get_readonly_context ( )

◆ is_ok()

bool ai::engine::is_ok ( ) const
virtual

Reimplemented in ai::engine_lua.

Definition at line 47 of file engine.cpp.

◆ parse_aspect_from_config()

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

◆ parse_candidate_action_from_config()

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

◆ parse_engine_from_config()

void ai::engine::parse_engine_from_config ( readonly_context context,
const config cfg,
std::back_insert_iterator< std::vector< engine_ptr >>  b 
)
static

◆ parse_goal_from_config()

void ai::engine::parse_goal_from_config ( readonly_context context,
const config cfg,
std::back_insert_iterator< std::vector< goal_ptr >>  b 
)
static

◆ parse_stage_from_config()

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 88 of file engine.cpp.

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

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

◆ set_ai_context()

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

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

Definition at line 124 of file engine.cpp.

References ai_context_.

◆ to_config()

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

serialize

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

Definition at line 134 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

◆ ai_

readonly_context& ai::engine::ai_
protected

◆ ai_context_

ai_context_ptr ai::engine::ai_context_
protected

Definition at line 94 of file engine.hpp.

Referenced by get_ai_context(), and set_ai_context().

◆ engine_

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

name of the engine which has created this engine

Definition at line 97 of file engine.hpp.

Referenced by get_engine(), and to_config().

◆ id_

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

Definition at line 98 of file engine.hpp.

Referenced by get_id().

◆ name_

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

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