Public Member Functions | Protected Member Functions | Protected Attributes

ai::stage Class Reference

#include <stage.hpp>

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

List of all members.

Public Member Functions

 stage (ai_context &context, const config &cfg)
 Constructor.
virtual void on_create ()
 Initialization.
virtual ~stage ()
 Destructor.
bool play_stage ()
 Play the turn - strategy.
int get_recursion_count () const
 get the value of the recursion counter
virtual config to_config () const
 serialize
virtual std::string get_id () const
virtual std::string get_name () const
virtual std::string get_engine () const

Protected Member Functions

virtual bool do_play_stage ()=0
 Play the turn - implementation.

Protected Attributes

recursion_counter recursion_counter_
config cfg_

Detailed Description

Definition at line 37 of file stage.hpp.


Constructor & Destructor Documentation

ai::stage::stage ( ai_context context,
const config cfg 
)

Constructor.

Definition at line 43 of file stage.cpp.

References ai::ai_context_proxy::init_ai_context_proxy().

Here is the call graph for this function:

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

Destructor.

Definition at line 54 of file stage.cpp.


Member Function Documentation

virtual bool ai::stage::do_play_stage (  )  [protected, pure virtual]

Play the turn - implementation.

Returns:
true only if game state has changed. Really only needed for ministages. Returning false is always safe.

Implemented in ai::lua_stage_wrapper, ai::idle_stage, ai::ai_default_recruitment_stage, ai::stage_side_formulas, ai::stage_unit_formulas, and ai::testing_ai_default::fallback_to_other_ai.

Referenced by play_stage().

Here is the caller graph for this function:

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

Implements ai::component.

Definition at line 82 of file stage.cpp.

References cfg_.

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

Implements ai::component.

Definition at line 77 of file stage.cpp.

References cfg_.

Referenced by ai::testing_ai_default::candidate_action_evaluation_loop::remove_completed_cas().

Here is the caller graph for this function:

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

Implements ai::component.

Definition at line 87 of file stage.cpp.

References cfg_.

int ai::stage::get_recursion_count (  )  const

get the value of the recursion counter

Definition at line 63 of file stage.cpp.

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

Here is the call graph for this function:

void ai::stage::on_create (  )  [virtual]

Initialization.

Reimplemented in ai::ai_default_recruitment_stage, ai::stage_side_formulas, ai::stage_unit_formulas, and ai::testing_ai_default::fallback_to_other_ai.

Definition at line 49 of file stage.cpp.

References cfg_, ai::side_context_proxy::get_side(), and LOG_AI_STAGE.

Here is the call graph for this function:

bool ai::stage::play_stage (  ) 

Play the turn - strategy.

Returns:
true only if game state has changed. Really only needed for ministages. Returning false is always safe.

Definition at line 58 of file stage.cpp.

References do_play_stage().

Here is the call graph for this function:

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

Member Data Documentation

config ai::stage::cfg_ [protected]

Definition at line 85 of file stage.hpp.

Referenced by get_recursion_count().


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:31 for The Battle for Wesnoth
Gna! | Forum | Wiki | CIA | devdocs