#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 | |
stats & | attacker_stats () |
stats & | defender_stats () |
Private Attributes | |
statistics_t * | stats_ |
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 |
Definition at line 58 of file statistics.hpp.
Definition at line 60 of file statistics.hpp.
Enumerator | |
---|---|
MISSES | |
HITS | |
KILLS |
Definition at line 64 of file statistics.hpp.
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 | ( | ) |
Definition at line 66 of file statistics.cpp.
References attacker_res, attacker_stats(), statistics_record::stats_t::attacks_inflicted, statistics_record::stats_t::attacks_taken, chance_to_hit_attacker, chance_to_hit_defender, defender_res, defender_stats(), statistics_record::stats_t::defends_inflicted, and statistics_record::stats_t::defends_taken.
void statistics_attack_context::attack_expected_damage | ( | double | attacker_inflict, |
double | defender_inflict | ||
) |
Definition at line 88 of file statistics.cpp.
References attacker_stats(), statistics_record::stats_t::decimal_shift, defender_stats(), statistics_record::stats_t::expected_damage_inflicted, statistics_record::stats_t::expected_damage_taken, statistics_record::stats_t::turn_expected_damage_inflicted, and statistics_record::stats_t::turn_expected_damage_taken.
void statistics_attack_context::attack_result | ( | hit_result | res, |
int | cth, | ||
int | damage, | ||
int | drain | ||
) |
Definition at line 103 of file statistics.cpp.
References attacker_res, attacker_stats(), statistics_record::stats_t::by_cth_inflicted, statistics_record::stats_t::damage_inflicted, statistics_record::stats_t::damage_taken, defender_stats(), defender_type, statistics_record::stats_t::killed, KILLS, MISSES, statistics_record::stats_t::turn_by_cth_inflicted, statistics_record::stats_t::turn_damage_inflicted, and statistics_record::stats_t::turn_damage_taken.
|
private |
Definition at line 78 of file statistics.cpp.
References attacker_side, statistics_t::get_stats(), and stats_.
Referenced by attack_expected_damage(), attack_result(), defend_result(), and ~statistics_attack_context().
void statistics_attack_context::defend_result | ( | hit_result | res, |
int | cth, | ||
int | damage, | ||
int | drain | ||
) |
Definition at line 138 of file statistics.cpp.
References attacker_stats(), attacker_type, statistics_record::stats_t::by_cth_taken, statistics_record::stats_t::damage_inflicted, statistics_record::stats_t::damage_taken, statistics_record::stats_t::deaths, defender_res, defender_stats(), KILLS, MISSES, statistics_record::stats_t::turn_by_cth_taken, statistics_record::stats_t::turn_damage_inflicted, and statistics_record::stats_t::turn_damage_taken.
|
private |
Definition at line 83 of file statistics.cpp.
References defender_side, statistics_t::get_stats(), and stats_.
Referenced by attack_expected_damage(), attack_result(), defend_result(), and ~statistics_attack_context().
|
private |
Definition at line 77 of file statistics.hpp.
Referenced by attack_result(), and ~statistics_attack_context().
|
private |
Definition at line 75 of file statistics.hpp.
Referenced by attacker_stats().
|
private |
Definition at line 74 of file statistics.hpp.
Referenced by defend_result().
|
private |
Definition at line 76 of file statistics.hpp.
Referenced by ~statistics_attack_context().
|
private |
Definition at line 76 of file statistics.hpp.
Referenced by ~statistics_attack_context().
|
private |
Definition at line 77 of file statistics.hpp.
Referenced by defend_result(), and ~statistics_attack_context().
|
private |
Definition at line 75 of file statistics.hpp.
Referenced by defender_stats().
|
private |
Definition at line 74 of file statistics.hpp.
Referenced by attack_result().
|
private |
never nullptr
Definition at line 72 of file statistics.hpp.
Referenced by attacker_stats(), and defender_stats().