Public Types | Public Member Functions | Protected Member Functions | Private Member Functions | Private Attributes

ai::action_result Class Reference

#include <actions.hpp>

Inheritance diagram for ai::action_result:
Inheritance graph
[legend]

List of all members.

Public Types

enum  tresult { AI_ACTION_SUCCESS = 0, AI_ACTION_STARTED = 1, AI_ACTION_FAILURE = -1 }

Public Member Functions

virtual ~action_result ()
void check_before ()
void execute ()
bool is_gamestate_changed () const
bool is_ok ()
int get_status () const
virtual std::string do_describe () const =0

Protected Member Functions

 action_result (side_number side)
virtual void do_check_before ()=0
virtual void do_check_after ()=0
virtual void do_execute ()=0
virtual void do_init_for_execution ()=0
bool is_execution () const
int get_side () const
game_infoget_info () const
teamget_my_team () const
void set_error (int error_code, bool log_as_error=true)
bool is_success () const
void set_gamestate_changed ()

Private Member Functions

void check_after ()
void init_for_execution ()
void set_ok_checked ()

Private Attributes

bool return_value_checked_
int side_
int status_
bool is_execution_
bool is_gamestate_changed_

Detailed Description

Definition at line 37 of file actions.hpp.


Member Enumeration Documentation

Enumerator:
AI_ACTION_SUCCESS 
AI_ACTION_STARTED 
AI_ACTION_FAILURE 

Reimplemented in ai::attack_result, ai::move_result, ai::recall_result, ai::recruit_result, and ai::stopunit_result.

Definition at line 40 of file actions.hpp.


Constructor & Destructor Documentation

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

Definition at line 64 of file actions.cpp.

ai::action_result::action_result ( side_number  side  )  [protected]

Definition at line 58 of file actions.cpp.


Member Function Documentation

void ai::action_result::check_after (  )  [private]

Definition at line 72 of file actions.cpp.

void ai::action_result::check_before (  ) 

Definition at line 78 of file actions.cpp.

References do_check_after().

Here is the call graph for this function:

virtual void ai::action_result::do_check_after (  )  [protected, pure virtual]

Implemented in ai::attack_result, ai::move_result, ai::recall_result, ai::recruit_result, and ai::stopunit_result.

Referenced by check_before().

Here is the caller graph for this function:

virtual void ai::action_result::do_check_before (  )  [protected, pure virtual]

Implemented in ai::attack_result, ai::move_result, ai::recall_result, ai::recruit_result, and ai::stopunit_result.

Referenced by execute().

Here is the caller graph for this function:

virtual std::string ai::action_result::do_describe (  )  const [pure virtual]
virtual void ai::action_result::do_execute (  )  [protected, pure virtual]
virtual void ai::action_result::do_init_for_execution (  )  [protected, pure virtual]
void ai::action_result::execute (  ) 

Definition at line 84 of file actions.cpp.

References do_check_before().

Here is the call graph for this function:

game_info & ai::action_result::get_info (  )  const [protected]

Definition at line 163 of file actions.cpp.

References is_execution_.

team & ai::action_result::get_my_team (  )  const [protected]

Definition at line 169 of file actions.cpp.

References ai::manager::get_active_ai_info_for_side(), and get_side().

Here is the call graph for this function:

int ai::action_result::get_side (  )  const [inline, protected]

Definition at line 84 of file actions.hpp.

References side_.

Referenced by get_my_team().

Here is the caller graph for this function:

int ai::action_result::get_status (  )  const

Definition at line 146 of file actions.cpp.

References is_gamestate_changed_.

void ai::action_result::init_for_execution (  )  [private]

Definition at line 104 of file actions.cpp.

bool ai::action_result::is_execution (  )  const [protected]

Definition at line 157 of file actions.cpp.

References AI_ACTION_SUCCESS, and status_.

bool ai::action_result::is_gamestate_changed (  )  const

Definition at line 113 of file actions.cpp.

bool ai::action_result::is_ok (  ) 

Definition at line 119 of file actions.cpp.

References is_gamestate_changed_.

bool ai::action_result::is_success (  )  const [protected]

Definition at line 151 of file actions.cpp.

References status_.

void ai::action_result::set_error ( int  error_code,
bool  log_as_error = true 
) [protected]

Definition at line 126 of file actions.cpp.

void ai::action_result::set_gamestate_changed (  )  [protected]

Definition at line 140 of file actions.cpp.

void ai::action_result::set_ok_checked (  )  [private]

Member Data Documentation

Definition at line 120 of file actions.hpp.

Referenced by get_info().

Definition at line 122 of file actions.hpp.

Referenced by get_status(), and is_ok().

Definition at line 111 of file actions.hpp.

int ai::action_result::side_ [private]

Definition at line 114 of file actions.hpp.

Referenced by get_side().

Definition at line 117 of file actions.hpp.

Referenced by is_execution(), and is_success().


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