The Battle for Wesnoth  1.19.4+dev
Classes | Public Types | Public Member Functions | Public Attributes | Static Public Attributes | List of all members
statistics_record::stats_t Struct Reference

#include <statistics_record.hpp>

Classes

struct  hitrate_t
 

Public Types

typedef std::map< std::string, int > str_int_map
 
typedef str_int_map battle_sequence_frequency_map
 
typedef std::map< int, battle_sequence_frequency_mapbattle_result_map
 A type that will map different % chances to hit to different results. More...
 
typedef std::map< int, hitrate_thitrate_map
 A type that maps chance-to-hit percentage to number of hits and strikes at that CTH. More...
 

Public Member Functions

 stats_t ()
 
 stats_t (const config &cfg)
 
config write () const
 
void write (config_writer &out) const
 
void read (const config &cfg)
 
void merge_with (const stats_t &other)
 

Public Attributes

str_int_map recruits
 
str_int_map recalls
 
str_int_map advanced_to
 
str_int_map deaths
 
str_int_map killed
 
int recruit_cost
 
int recall_cost
 
battle_result_map attacks_inflicted
 Statistics of this side's attacks on its own turns. More...
 
battle_result_map defends_inflicted
 Statistics of this side's attacks on enemies' turns. More...
 
battle_result_map attacks_taken
 Statistics of enemies' counter attacks on this side's turns. More...
 
battle_result_map defends_taken
 Statistics of enemies' attacks against this side on their turns. More...
 
long long damage_inflicted
 
long long damage_taken
 
long long turn_damage_inflicted
 
long long turn_damage_taken
 
hitrate_map by_cth_inflicted
 
hitrate_map by_cth_taken
 
hitrate_map turn_by_cth_inflicted
 
hitrate_map turn_by_cth_taken
 
long long expected_damage_inflicted
 
long long expected_damage_taken
 
long long turn_expected_damage_inflicted
 
long long turn_expected_damage_taken
 
std::string save_id
 

Static Public Attributes

static const int decimal_shift = 1000
 

Detailed Description

Definition at line 27 of file statistics_record.hpp.

Member Typedef Documentation

◆ battle_result_map

A type that will map different % chances to hit to different results.

Definition at line 49 of file statistics_record.hpp.

◆ battle_sequence_frequency_map

Definition at line 46 of file statistics_record.hpp.

◆ hitrate_map

A type that maps chance-to-hit percentage to number of hits and strikes at that CTH.

Definition at line 72 of file statistics_record.hpp.

◆ str_int_map

typedef std::map<std::string,int> statistics_record::stats_t::str_int_map

Definition at line 38 of file statistics_record.hpp.

Constructor & Destructor Documentation

◆ stats_t() [1/2]

statistics_record::stats_t::stats_t ( )

Definition at line 187 of file statistics_record.cpp.

◆ stats_t() [2/2]

statistics_record::stats_t::stats_t ( const config cfg)
explicit

Definition at line 215 of file statistics_record.cpp.

References read().

Member Function Documentation

◆ merge_with()

void statistics_record::stats_t::merge_with ( const stats_t other)

◆ read()

void statistics_record::stats_t::read ( const config cfg)

◆ write() [1/2]

config statistics_record::stats_t::write ( ) const

◆ write() [2/2]

void statistics_record::stats_t::write ( config_writer out) const

Member Data Documentation

◆ advanced_to

str_int_map statistics_record::stats_t::advanced_to

◆ attacks_inflicted

battle_result_map statistics_record::stats_t::attacks_inflicted

Statistics of this side's attacks on its own turns.

Definition at line 52 of file statistics_record.hpp.

Referenced by merge_with(), read(), write(), and statistics_attack_context::~statistics_attack_context().

◆ attacks_taken

battle_result_map statistics_record::stats_t::attacks_taken

Statistics of enemies' counter attacks on this side's turns.

Definition at line 56 of file statistics_record.hpp.

Referenced by merge_with(), read(), write(), and statistics_attack_context::~statistics_attack_context().

◆ by_cth_inflicted

hitrate_map statistics_record::stats_t::by_cth_inflicted

◆ by_cth_taken

hitrate_map statistics_record::stats_t::by_cth_taken

◆ damage_inflicted

long long statistics_record::stats_t::damage_inflicted

◆ damage_taken

long long statistics_record::stats_t::damage_taken

◆ deaths

str_int_map statistics_record::stats_t::deaths

◆ decimal_shift

const int statistics_record::stats_t::decimal_shift = 1000
static

◆ defends_inflicted

battle_result_map statistics_record::stats_t::defends_inflicted

Statistics of this side's attacks on enemies' turns.

Definition at line 54 of file statistics_record.hpp.

Referenced by merge_with(), read(), write(), and statistics_attack_context::~statistics_attack_context().

◆ defends_taken

battle_result_map statistics_record::stats_t::defends_taken

Statistics of enemies' attacks against this side on their turns.

Definition at line 58 of file statistics_record.hpp.

Referenced by merge_with(), read(), write(), and statistics_attack_context::~statistics_attack_context().

◆ expected_damage_inflicted

long long statistics_record::stats_t::expected_damage_inflicted

◆ expected_damage_taken

long long statistics_record::stats_t::expected_damage_taken

◆ killed

str_int_map statistics_record::stats_t::killed

◆ recall_cost

int statistics_record::stats_t::recall_cost

Definition at line 40 of file statistics_record.hpp.

Referenced by merge_with(), read(), and write().

◆ recalls

str_int_map statistics_record::stats_t::recalls

◆ recruit_cost

int statistics_record::stats_t::recruit_cost

Definition at line 40 of file statistics_record.hpp.

Referenced by merge_with(), read(), and write().

◆ recruits

str_int_map statistics_record::stats_t::recruits

◆ save_id

std::string statistics_record::stats_t::save_id

Definition at line 84 of file statistics_record.hpp.

Referenced by read(), and write().

◆ turn_by_cth_inflicted

hitrate_map statistics_record::stats_t::turn_by_cth_inflicted

◆ turn_by_cth_taken

hitrate_map statistics_record::stats_t::turn_by_cth_taken

◆ turn_damage_inflicted

long long statistics_record::stats_t::turn_damage_inflicted

◆ turn_damage_taken

long long statistics_record::stats_t::turn_damage_taken

◆ turn_expected_damage_inflicted

long long statistics_record::stats_t::turn_expected_damage_inflicted

◆ turn_expected_damage_taken

long long statistics_record::stats_t::turn_expected_damage_taken

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