The Battle for Wesnoth  1.19.17+dev
Public Member Functions | Public Attributes | List of all members
ai::default_recruitment::attack_simulation Struct Reference

For Combat Analysis. More...

Public Member Functions

 attack_simulation (nonempty_unit_const_ptr attacker, nonempty_unit_const_ptr defender, double attacker_defense, double defender_defense, size_t i_att_weapon, size_t i_def_weapon, int average_lawful_bonus)
 
bool better_result (const attack_simulation *other, bool for_defender)
 
double get_avg_hp_of_defender () const
 
double get_avg_hp_of_attacker () const
 
double get_avg_hp_of_combatant (bool attacker) const
 

Public Attributes

nonempty_unit_const_ptr attacker_u
 
nonempty_unit_const_ptr defender_u
 
const battle_context_unit_stats attacker_stats
 
const battle_context_unit_stats defender_stats
 
combatant attacker_combatant
 
combatant defender_combatant
 

Detailed Description

For Combat Analysis.

This struct encapsulates all information for one attack simulation. One attack simulation is defined by the unit-types, the weapons and the units defenses.

Definition at line 1099 of file recruitment.cpp.

Constructor & Destructor Documentation

◆ attack_simulation()

ai::default_recruitment::attack_simulation::attack_simulation ( nonempty_unit_const_ptr  attacker,
nonempty_unit_const_ptr  defender,
double  attacker_defense,
double  defender_defense,
size_t  i_att_weapon,
size_t  i_def_weapon,
int  average_lawful_bonus 
)
inline

Definition at line 1107 of file recruitment.cpp.

References attacker_combatant, defender_combatant, and combatant::fight().

Member Function Documentation

◆ better_result()

bool ai::default_recruitment::attack_simulation::better_result ( const attack_simulation other,
bool  for_defender 
)
inline

◆ get_avg_hp_of_attacker()

double ai::default_recruitment::attack_simulation::get_avg_hp_of_attacker ( ) const
inline

Definition at line 1140 of file recruitment.cpp.

References get_avg_hp_of_combatant().

◆ get_avg_hp_of_combatant()

double ai::default_recruitment::attack_simulation::get_avg_hp_of_combatant ( bool  attacker) const
inline

◆ get_avg_hp_of_defender()

double ai::default_recruitment::attack_simulation::get_avg_hp_of_defender ( ) const
inline

Definition at line 1136 of file recruitment.cpp.

References get_avg_hp_of_combatant().

Member Data Documentation

◆ attacker_combatant

combatant ai::default_recruitment::attack_simulation::attacker_combatant

Definition at line 1104 of file recruitment.cpp.

Referenced by attack_simulation(), better_result(), and get_avg_hp_of_combatant().

◆ attacker_stats

const battle_context_unit_stats ai::default_recruitment::attack_simulation::attacker_stats

Definition at line 1102 of file recruitment.cpp.

◆ attacker_u

nonempty_unit_const_ptr ai::default_recruitment::attack_simulation::attacker_u

Definition at line 1100 of file recruitment.cpp.

Referenced by get_avg_hp_of_combatant().

◆ defender_combatant

combatant ai::default_recruitment::attack_simulation::defender_combatant

Definition at line 1105 of file recruitment.cpp.

Referenced by attack_simulation(), better_result(), and get_avg_hp_of_combatant().

◆ defender_stats

const battle_context_unit_stats ai::default_recruitment::attack_simulation::defender_stats

Definition at line 1103 of file recruitment.cpp.

◆ defender_u

nonempty_unit_const_ptr ai::default_recruitment::attack_simulation::defender_u

Definition at line 1101 of file recruitment.cpp.

Referenced by get_avg_hp_of_combatant().


The documentation for this struct was generated from the following file: