The Battle for Wesnoth  1.13.4+dev
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
Public Types | Public Member Functions | Protected Member Functions | Private Member Functions | Private Attributes | List of all members
ai::recall_result Class Reference

#include <actions.hpp>

Inheritance diagram for ai::recall_result:
Inheritance graph

Public Types

enum  tresult {
  E_NOT_AVAILABLE_FOR_RECALLING = 6001, E_NO_GOLD = 6003, E_NO_LEADER = 6004, E_LEADER_NOT_ON_KEEP = 6005,
  E_BAD_RECALL_LOCATION = 6006
}
 
- Public Types inherited from ai::action_result
enum  tresult { AI_ACTION_SUCCESS = 0, AI_ACTION_STARTED = 1, AI_ACTION_FAILURE = -1 }
 

Public Member Functions

 recall_result (side_number side, const std::string &unit_id, const map_location &where, const map_location &from)
 
virtual std::string do_describe () const
 
- Public Member Functions inherited from ai::action_result
virtual ~action_result ()
 
void check_before ()
 
void execute ()
 
bool is_gamestate_changed () const
 
bool is_ok ()
 
int get_status () const
 

Protected Member Functions

virtual void do_check_before ()
 
virtual void do_check_after ()
 
virtual void do_execute ()
 
virtual void do_init_for_execution ()
 
- Protected Member Functions inherited from ai::action_result
 action_result (side_number side)
 
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

unit_const_ptr get_recall_unit (const team &my_team)
 
bool test_enough_gold (const team &my_team)
 

Private Attributes

const std::stringunit_id_
 
const map_location where_
 
map_location recall_location_
 
map_location recall_from_
 
bool location_checked_
 

Detailed Description

Definition at line 207 of file actions.hpp.

Member Enumeration Documentation

Enumerator
E_NOT_AVAILABLE_FOR_RECALLING 
E_NO_GOLD 
E_NO_LEADER 
E_LEADER_NOT_ON_KEEP 
E_BAD_RECALL_LOCATION 

Definition at line 211 of file actions.hpp.

Constructor & Destructor Documentation

ai::recall_result::recall_result ( side_number  side,
const std::string unit_id,
const map_location where,
const map_location from 
)

Definition at line 526 of file actions.cpp.

Member Function Documentation

void ai::recall_result::do_check_after ( )
protectedvirtual
void ai::recall_result::do_check_before ( )
protectedvirtual
std::string ai::recall_result::do_describe ( ) const
virtual

Implements ai::action_result.

Definition at line 618 of file actions.cpp.

References ai::action_result::get_side(), map_location::null_location(), unit_id_, and where_.

Referenced by operator<<().

void ai::recall_result::do_execute ( )
protectedvirtual
void ai::recall_result::do_init_for_execution ( )
protectedvirtual

Implements ai::action_result.

Definition at line 671 of file actions.cpp.

unit_const_ptr ai::recall_result::get_recall_unit ( const team my_team)
private
bool ai::recall_result::test_enough_gold ( const team my_team)
private

Definition at line 546 of file actions.cpp.

References E_NO_GOLD, team::gold(), team::recall_cost(), and ai::action_result::set_error().

Referenced by do_check_before().

Member Data Documentation

bool ai::recall_result::location_checked_
private

Definition at line 235 of file actions.hpp.

Referenced by do_check_before(), and do_execute().

map_location ai::recall_result::recall_from_
private

Definition at line 234 of file actions.hpp.

Referenced by do_check_before(), and do_execute().

map_location ai::recall_result::recall_location_
private

Definition at line 233 of file actions.hpp.

Referenced by do_check_after(), do_check_before(), and do_execute().

const std::string& ai::recall_result::unit_id_
private

Definition at line 231 of file actions.hpp.

Referenced by do_describe(), do_execute(), and get_recall_unit().

const map_location ai::recall_result::where_
private

Definition at line 232 of file actions.hpp.

Referenced by do_describe().


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