The Battle for Wesnoth  1.17.0-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 (const unit_type *attacker, const unit_type *defender, double attacker_defense, double defender_defense, const_attack_ptr att_weapon, const_attack_ptr 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

const unit_typeattacker_type
const unit_typedefender_type
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 1087 of file recruitment.cpp.

Constructor & Destructor Documentation

◆ attack_simulation()

ai::default_recruitment::attack_simulation::attack_simulation ( const unit_type attacker,
const unit_type defender,
double  attacker_defense,
double  defender_defense,
const_attack_ptr  att_weapon,
const_attack_ptr  def_weapon,
int  average_lawful_bonus 

Definition at line 1095 of file recruitment.cpp.

References combatant::fight().

Member Function Documentation

◆ better_result()

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

◆ get_avg_hp_of_attacker()

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

Definition at line 1128 of file recruitment.cpp.

◆ get_avg_hp_of_combatant()

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

◆ get_avg_hp_of_defender()

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

Definition at line 1124 of file recruitment.cpp.

Member Data Documentation

◆ attacker_combatant

combatant ai::default_recruitment::attack_simulation::attacker_combatant

Definition at line 1092 of file recruitment.cpp.

Referenced by better_result().

◆ attacker_stats

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

Definition at line 1090 of file recruitment.cpp.

◆ attacker_type

const unit_type* ai::default_recruitment::attack_simulation::attacker_type

Definition at line 1088 of file recruitment.cpp.

◆ defender_combatant

combatant ai::default_recruitment::attack_simulation::defender_combatant

Definition at line 1093 of file recruitment.cpp.

Referenced by better_result().

◆ defender_stats

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

Definition at line 1091 of file recruitment.cpp.

◆ defender_type

const unit_type* ai::default_recruitment::attack_simulation::defender_type

Definition at line 1089 of file recruitment.cpp.

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