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

#include <actions.hpp>

Inheritance diagram for ai::attack_result:
Inheritance graph

Public Types

enum  result {
  E_EMPTY_ATTACKER = 1001, E_EMPTY_DEFENDER = 1002, E_INCAPACITATED_ATTACKER = 1003, E_INCAPACITATED_DEFENDER = 1004,
  E_NOT_OWN_ATTACKER = 1005, E_NOT_ENEMY_DEFENDER = 1006, E_NO_ATTACKS_LEFT = 1007, E_WRONG_ATTACKER_WEAPON = 1008,
  E_UNABLE_TO_CHOOSE_ATTACKER_WEAPON = 1009, E_ATTACKER_AND_DEFENDER_NOT_ADJACENT = 1010
}
 
- Public Types inherited from ai::action_result
enum  result { AI_ACTION_SUCCESS = 0, AI_ACTION_STARTED = 1, AI_ACTION_FAILURE = -1 }
 

Public Member Functions

 attack_result (side_number side, const map_location &attacker_loc, const map_location &defender_loc, int attacker_weapon, double aggression, const unit_advancements_aspect &advancements=unit_advancements_aspect())
 
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 Attributes

const map_locationattacker_loc_
 
const map_locationdefender_loc_
 
int attacker_weapon_
 
double aggression_
 
const unit_advancements_aspectadvancements_
 

Detailed Description

Definition at line 130 of file actions.hpp.

Member Enumeration Documentation

Enumerator
E_EMPTY_ATTACKER 
E_EMPTY_DEFENDER 
E_INCAPACITATED_ATTACKER 
E_INCAPACITATED_DEFENDER 
E_NOT_OWN_ATTACKER 
E_NOT_ENEMY_DEFENDER 
E_NO_ATTACKS_LEFT 
E_WRONG_ATTACKER_WEAPON 
E_UNABLE_TO_CHOOSE_ATTACKER_WEAPON 
E_ATTACKER_AND_DEFENDER_NOT_ADJACENT 

Definition at line 139 of file actions.hpp.

Constructor & Destructor Documentation

ai::attack_result::attack_result ( side_number  side,
const map_location attacker_loc,
const map_location defender_loc,
int  attacker_weapon,
double  aggression,
const unit_advancements_aspect advancements = unit_advancements_aspect() 
)

Definition at line 174 of file actions.cpp.

Member Function Documentation

void ai::attack_result::do_check_after ( )
protectedvirtual

Implements ai::action_result.

Definition at line 243 of file actions.cpp.

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

Implements ai::action_result.

Definition at line 247 of file actions.cpp.

References aggression_, attacker_loc_, attacker_weapon_, defender_loc_, ai::action_result::get_side(), and s.

Referenced by operator<<().

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

Implements ai::action_result.

Definition at line 321 of file actions.cpp.

Member Data Documentation

const unit_advancements_aspect& ai::attack_result::advancements_
private

Definition at line 163 of file actions.hpp.

Referenced by do_execute().

double ai::attack_result::aggression_
private

Definition at line 162 of file actions.hpp.

Referenced by do_describe(), and do_execute().

const map_location& ai::attack_result::attacker_loc_
private

Definition at line 159 of file actions.hpp.

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

int ai::attack_result::attacker_weapon_
private

Definition at line 161 of file actions.hpp.

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

const map_location& ai::attack_result::defender_loc_
private

Definition at line 160 of file actions.hpp.

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


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