The Battle for Wesnoth  1.19.0-dev
Public Types | Public Member Functions | Private Member Functions | Private Attributes | List of all members
statistics_attack_context Struct Reference

#include <statistics.hpp>

Public Types

enum  hit_result { MISSES , HITS , KILLS }
 
using stats = statistics_t::stats
 

Public Member Functions

 statistics_attack_context (statistics_t &stats, const unit &a, const unit &d, int a_cth, int d_cth)
 
 ~statistics_attack_context ()
 
void attack_expected_damage (double attacker_inflict, double defender_inflict)
 
void attack_result (hit_result res, int cth, int damage, int drain)
 
void defend_result (hit_result res, int cth, int damage, int drain)
 

Private Member Functions

statsattacker_stats ()
 
statsdefender_stats ()
 

Private Attributes

statistics_tstats_
 never nullptr More...
 
std::string attacker_type
 
std::string defender_type
 
std::string attacker_side
 
std::string defender_side
 
int chance_to_hit_defender
 
int chance_to_hit_attacker
 
std::string attacker_res
 
std::string defender_res
 

Detailed Description

Definition at line 58 of file statistics.hpp.

Member Typedef Documentation

◆ stats

Definition at line 60 of file statistics.hpp.

Member Enumeration Documentation

◆ hit_result

Enumerator
MISSES 
HITS 
KILLS 

Definition at line 64 of file statistics.hpp.

Constructor & Destructor Documentation

◆ statistics_attack_context()

statistics_attack_context::statistics_attack_context ( statistics_t stats,
const unit a,
const unit d,
int  a_cth,
int  d_cth 
)

Definition at line 52 of file statistics.cpp.

◆ ~statistics_attack_context()

statistics_attack_context::~statistics_attack_context ( )

Member Function Documentation

◆ attack_expected_damage()

void statistics_attack_context::attack_expected_damage ( double  attacker_inflict,
double  defender_inflict 
)

◆ attack_result()

void statistics_attack_context::attack_result ( hit_result  res,
int  cth,
int  damage,
int  drain 
)

◆ attacker_stats()

statistics_attack_context::stats & statistics_attack_context::attacker_stats ( )
private

◆ defend_result()

void statistics_attack_context::defend_result ( hit_result  res,
int  cth,
int  damage,
int  drain 
)

◆ defender_stats()

statistics_attack_context::stats & statistics_attack_context::defender_stats ( )
private

Member Data Documentation

◆ attacker_res

std::string statistics_attack_context::attacker_res
private

Definition at line 77 of file statistics.hpp.

Referenced by attack_result(), and ~statistics_attack_context().

◆ attacker_side

std::string statistics_attack_context::attacker_side
private

Definition at line 75 of file statistics.hpp.

Referenced by attacker_stats().

◆ attacker_type

std::string statistics_attack_context::attacker_type
private

Definition at line 74 of file statistics.hpp.

Referenced by defend_result().

◆ chance_to_hit_attacker

int statistics_attack_context::chance_to_hit_attacker
private

Definition at line 76 of file statistics.hpp.

Referenced by ~statistics_attack_context().

◆ chance_to_hit_defender

int statistics_attack_context::chance_to_hit_defender
private

Definition at line 76 of file statistics.hpp.

Referenced by ~statistics_attack_context().

◆ defender_res

std::string statistics_attack_context::defender_res
private

Definition at line 77 of file statistics.hpp.

Referenced by defend_result(), and ~statistics_attack_context().

◆ defender_side

std::string statistics_attack_context::defender_side
private

Definition at line 75 of file statistics.hpp.

Referenced by defender_stats().

◆ defender_type

std::string statistics_attack_context::defender_type
private

Definition at line 74 of file statistics.hpp.

Referenced by attack_result().

◆ stats_

statistics_t* statistics_attack_context::stats_
private

never nullptr

Definition at line 72 of file statistics.hpp.

Referenced by attacker_stats(), and defender_stats().


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