The Battle for Wesnoth  1.15.1+dev
Classes | Public Types | Public Member Functions | Public Attributes | Static Public Attributes | List of all members
statistics::stats Struct Reference

#include <statistics.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 ()
 
 stats (const config &cfg)
 
config write () const
 
void write (config_writer &out) const
 
void read (const config &cfg)
 

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 28 of file statistics.hpp.

Member Typedef Documentation

◆ battle_result_map

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

Definition at line 48 of file statistics.hpp.

◆ battle_sequence_frequency_map

Definition at line 45 of file statistics.hpp.

◆ hitrate_map

typedef std::map<int, hitrate_t> statistics::stats::hitrate_map

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

Definition at line 71 of file statistics.hpp.

◆ str_int_map

typedef std::map<std::string,int> statistics::stats::str_int_map

Definition at line 37 of file statistics.hpp.

Constructor & Destructor Documentation

◆ stats() [1/2]

statistics::stats::stats ( )

Definition at line 306 of file statistics.cpp.

◆ stats() [2/2]

statistics::stats::stats ( const config cfg)
explicit

Definition at line 333 of file statistics.cpp.

References read().

Member Function Documentation

◆ read()

void statistics::stats::read ( const config cfg)

◆ write() [1/2]

config statistics::stats::write ( ) const

◆ write() [2/2]

void statistics::stats::write ( config_writer out) const

Member Data Documentation

◆ advanced_to

str_int_map statistics::stats::advanced_to

◆ attacks_inflicted

battle_result_map statistics::stats::attacks_inflicted

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

Definition at line 51 of file statistics.hpp.

Referenced by read(), write(), and statistics::attack_context::~attack_context().

◆ attacks_taken

battle_result_map statistics::stats::attacks_taken

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

Definition at line 55 of file statistics.hpp.

Referenced by read(), write(), and statistics::attack_context::~attack_context().

◆ by_cth_inflicted

hitrate_map statistics::stats::by_cth_inflicted

◆ by_cth_taken

hitrate_map statistics::stats::by_cth_taken

◆ damage_inflicted

long long statistics::stats::damage_inflicted

◆ damage_taken

long long statistics::stats::damage_taken

◆ deaths

str_int_map statistics::stats::deaths

◆ decimal_shift

const int statistics::stats::decimal_shift = 1000
static

◆ defends_inflicted

battle_result_map statistics::stats::defends_inflicted

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

Definition at line 53 of file statistics.hpp.

Referenced by read(), write(), and statistics::attack_context::~attack_context().

◆ defends_taken

battle_result_map statistics::stats::defends_taken

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

Definition at line 57 of file statistics.hpp.

Referenced by read(), write(), and statistics::attack_context::~attack_context().

◆ expected_damage_inflicted

long long statistics::stats::expected_damage_inflicted

◆ expected_damage_taken

long long statistics::stats::expected_damage_taken

◆ killed

str_int_map statistics::stats::killed

◆ recall_cost

int statistics::stats::recall_cost

Definition at line 39 of file statistics.hpp.

Referenced by read(), statistics::recall_unit(), statistics::un_recall_unit(), and write().

◆ recalls

str_int_map statistics::stats::recalls

◆ recruit_cost

int statistics::stats::recruit_cost

Definition at line 39 of file statistics.hpp.

Referenced by read(), statistics::recruit_unit(), statistics::un_recruit_unit(), and write().

◆ recruits

str_int_map statistics::stats::recruits

◆ save_id

std::string statistics::stats::save_id

Definition at line 83 of file statistics.hpp.

Referenced by read(), statistics::reset_turn_stats(), and write().

◆ turn_by_cth_inflicted

hitrate_map statistics::stats::turn_by_cth_inflicted

◆ turn_by_cth_taken

hitrate_map statistics::stats::turn_by_cth_taken

◆ turn_damage_inflicted

long long statistics::stats::turn_damage_inflicted

◆ turn_damage_taken

long long statistics::stats::turn_damage_taken

◆ turn_expected_damage_inflicted

long long statistics::stats::turn_expected_damage_inflicted

◆ turn_expected_damage_taken

long long statistics::stats::turn_expected_damage_taken

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