Public Member Functions | Protected Attributes

ai::ai_composite Class Reference

#include <ai.hpp>

Inheritance diagram for ai::ai_composite:
Inheritance graph
[legend]
Collaboration diagram for ai::ai_composite:
Collaboration graph
[legend]

List of all members.

Public Member Functions

 ai_composite (default_ai_context &context, const config &cfg)
 Constructor.
virtual ~ai_composite ()
 Destructor.
void play_turn ()
 Play the turn.
virtual std::string evaluate (const std::string &str)
 Evaluate command (using fai).
virtual void new_turn ()
 On new turn.
std::string describe_self () const
virtual config to_config () const
 serialize
int get_recursion_count () const
void switch_side (side_number side)
virtual bool add_goal (const config &cfg)
virtual bool add_stage (const config &cfg)
void create_stage (std::vector< stage_ptr > &stages, const config &cfg)
void create_goal (std::vector< goal_ptr > &goals, const config &cfg)
void create_engine (std::vector< engine_ptr > &engines, const config &cfg)
void on_create ()
virtual ai_contextget_ai_context ()
 unwrap
virtual std::string get_id () const
virtual std::string get_name () const
virtual std::string get_engine () const

Protected Attributes

const configcfg_
 Config of the AI.
std::vector< stage_ptrstages_
 Stages of the composite AI.
recursion_counter recursion_counter_
 Recursion counter.

Detailed Description

Definition at line 37 of file ai.hpp.


Constructor & Destructor Documentation

ai::ai_composite::ai_composite ( default_ai_context context,
const config cfg 
)

Constructor.

Definition at line 41 of file ai.cpp.

ai::ai_composite::~ai_composite (  )  [virtual]

Destructor.

Definition at line 98 of file ai.cpp.

References ai::engine::parse_goal_from_config().

Here is the call graph for this function:


Member Function Documentation

bool ai::ai_composite::add_goal ( const config cfg  )  [virtual]

Definition at line 116 of file ai.cpp.

bool ai::ai_composite::add_stage ( const config cfg  )  [virtual]

Definition at line 103 of file ai.cpp.

References ai::engine::parse_engine_from_config().

Here is the call graph for this function:

void ai::ai_composite::create_engine ( std::vector< engine_ptr > &  engines,
const config cfg 
)

Definition at line 93 of file ai.cpp.

void ai::ai_composite::create_goal ( std::vector< goal_ptr > &  goals,
const config cfg 
)

Definition at line 87 of file ai.cpp.

void ai::ai_composite::create_stage ( std::vector< stage_ptr > &  stages,
const config cfg 
)

Definition at line 81 of file ai.cpp.

std::string ai::ai_composite::describe_self (  )  const

Definition at line 36 of file ai.cpp.

References ai::log_ai_composite.

std::string ai::ai_composite::evaluate ( const std::string &  str  )  [virtual]

Evaluate command (using fai).

Todo:
1.9 : consider allowing other engines to evaluate

Definition at line 155 of file ai.cpp.

ai_context & ai::ai_composite::get_ai_context (  )  [virtual]

unwrap

Definition at line 188 of file ai.cpp.

References ai::recursion_counter::get_count(), and recursion_counter_.

Here is the call graph for this function:

std::string ai::ai_composite::get_engine (  )  const [virtual]

Implements ai::component.

Definition at line 149 of file ai.cpp.

std::string ai::ai_composite::get_id (  )  const [virtual]

Implements ai::component.

Definition at line 136 of file ai.cpp.

std::string ai::ai_composite::get_name (  )  const [virtual]

Implements ai::component.

Definition at line 143 of file ai.cpp.

int ai::ai_composite::get_recursion_count (  )  const
void ai::ai_composite::new_turn (  )  [virtual]

On new turn.

Todo:
1.9 replace with event system

Definition at line 167 of file ai.cpp.

void ai::ai_composite::on_create (  ) 

Definition at line 47 of file ai.cpp.

void ai::ai_composite::play_turn (  ) 

Play the turn.

Definition at line 129 of file ai.cpp.

void ai::ai_composite::switch_side ( side_number  side  ) 

Definition at line 183 of file ai.cpp.

config ai::ai_composite::to_config (  )  const [virtual]

serialize

Definition at line 194 of file ai.cpp.

References ai::side_context_proxy::set_side().

Here is the call graph for this function:


Member Data Documentation

const config& ai::ai_composite::cfg_ [protected]

Config of the AI.

Definition at line 116 of file ai.hpp.

Recursion counter.

Definition at line 128 of file ai.hpp.

Referenced by get_ai_context().

std::vector< stage_ptr > ai::ai_composite::stages_ [protected]

Stages of the composite AI.

Definition at line 122 of file ai.hpp.


The documentation for this class was generated from the following files:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines

Generated by doxygen 1.7.1 on Thu May 24 2012 01:18:21 for The Battle for Wesnoth
Gna! | Forum | Wiki | CIA | devdocs