Public Member Functions | Private Attributes

ai::idle_ai Class Reference

A trivial ai that sits around doing absolutely nothing. More...

#include <ai.hpp>

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

List of all members.

Public Member Functions

 idle_ai (readwrite_context &context, const config &cfg)
void play_turn ()
 Function that is called when the AI must play its turn.
void new_turn ()
 Function called when a a new turn is played.
std::string describe_self () const
 Describe self.
void switch_side (side_number side)
int get_recursion_count () const
virtual config to_config () const
 serialize to config

Private Attributes

const configcfg_
recursion_counter recursion_counter_

Detailed Description

A trivial ai that sits around doing absolutely nothing.

Definition at line 43 of file ai.hpp.


Constructor & Destructor Documentation

ai::idle_ai::idle_ai ( readwrite_context context,
const config cfg 
)

Definition at line 60 of file ai.cpp.

References ai::readwrite_context_proxy::init_readwrite_context_proxy().

Here is the call graph for this function:


Member Function Documentation

std::string ai::idle_ai::describe_self (  )  const [virtual]

Describe self.

Reimplemented from ai::interface.

Definition at line 66 of file ai.cpp.

int ai::idle_ai::get_recursion_count (  )  const

Definition at line 91 of file ai.cpp.

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

Here is the call graph for this function:

void ai::idle_ai::new_turn (  )  [virtual]

Function called when a a new turn is played.

Implements ai::interface.

Definition at line 72 of file ai.cpp.

void ai::idle_ai::play_turn (  )  [virtual]

Function that is called when the AI must play its turn.

Derived classes should implement their AI algorithm in this function.

Implements ai::interface.

Definition at line 97 of file ai.cpp.

References game_events::fire().

Here is the call graph for this function:

void ai::idle_ai::switch_side ( side_number  side  )  [virtual]

Implements ai::interface.

Definition at line 77 of file ai.cpp.

References ai::side_context_proxy::set_side().

Here is the call graph for this function:

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

serialize to config

Implements ai::interface.

Definition at line 83 of file ai.cpp.


Member Data Documentation

const config& ai::idle_ai::cfg_ [private]

Definition at line 53 of file ai.hpp.

Definition at line 54 of file ai.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:54 for The Battle for Wesnoth
Gna! | Forum | Wiki | CIA | devdocs