The Battle for Wesnoth  1.13.4+dev
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
Namespaces | Macros | Functions | Variables
statistics.cpp File Reference

Manage statistics: recruitments, recalls, kills, losses, etc. More...

#include "global.hpp"
#include "statistics.hpp"
#include "log.hpp"
#include "resources.hpp"
#include "serialization/binary_or_text.hpp"
#include "team.hpp"
#include "units/unit.hpp"
#include "util.hpp"
Include dependency graph for statistics.cpp:

Go to the source code of this file.

Namespaces

 statistics
 

Macros

#define DBG_NG   LOG_STREAM(debug, log_engine)
 
#define ERR_NG   LOG_STREAM(err, log_engine)
 

Functions

static stats & get_stats (const std::string &save_id)
 
static config write_str_int_map (const stats::str_int_map &m)
 
static void write_str_int_map (config_writer &out, const stats::str_int_map &m)
 
static stats::str_int_map read_str_int_map (const config &cfg)
 
static config write_battle_result_map (const stats::battle_result_map &m)
 
static void write_battle_result_map (config_writer &out, const stats::battle_result_map &m)
 
static stats::battle_result_map read_battle_result_map (const config &cfg)
 
static void merge_str_int_map (stats::str_int_map &a, const stats::str_int_map &b)
 
static void merge_battle_result_maps (stats::battle_result_map &a, const stats::battle_result_map &b)
 
static void merge_stats (stats &a, const stats &b)
 
void statistics::recruit_unit (const unit &u)
 
void statistics::recall_unit (const unit &u)
 
void statistics::un_recall_unit (const unit &u)
 
void statistics::un_recruit_unit (const unit &u)
 
int statistics::un_recall_unit_cost (const unit &u)
 
void statistics::advance_unit (const unit &u)
 
void statistics::reset_turn_stats (const std::string &save_id)
 
stats statistics::calculate_stats (const std::string &save_id)
 
levels statistics::level_stats (const std::string &save_id)
 Returns a list of names and stats for each scenario in the current campaign. More...
 
config statistics::write_stats ()
 
void statistics::write_stats (config_writer &out)
 
void statistics::read_stats (const config &cfg)
 
void statistics::fresh_stats ()
 
void statistics::clear_current_scenario ()
 
int statistics::sum_str_int_map (const stats::str_int_map &m)
 
int statistics::sum_cost_str_int_map (const stats::str_int_map &m)
 

Variables

static lg::log_domain log_engine ("engine")
 

Detailed Description

Manage statistics: recruitments, recalls, kills, losses, etc.

Definition in file statistics.cpp.

Macro Definition Documentation

#define DBG_NG   LOG_STREAM(debug, log_engine)

Definition at line 30 of file statistics.cpp.

Referenced by statistics::calculate_stats(), and merge_stats().

#define ERR_NG   LOG_STREAM(err, log_engine)

Definition at line 31 of file statistics.cpp.

Referenced by statistics::sum_cost_str_int_map().

Function Documentation

static stats& get_stats ( const std::string save_id)
static
static void merge_battle_result_maps ( stats::battle_result_map &  a,
const stats::battle_result_map &  b 
)
static

Definition at line 178 of file statistics.cpp.

References i, and merge_str_int_map().

Referenced by merge_stats().

static void merge_stats ( stats &  a,
const stats &  b 
)
static

Definition at line 185 of file statistics.cpp.

References DBG_NG, merge_battle_result_maps(), and merge_str_int_map().

Referenced by statistics::calculate_stats().

static void merge_str_int_map ( stats::str_int_map &  a,
const stats::str_int_map &  b 
)
static

Definition at line 171 of file statistics.cpp.

References i.

Referenced by merge_battle_result_maps(), and merge_stats().

static stats::battle_result_map read_battle_result_map ( const config cfg)
static
static stats::str_int_map read_str_int_map ( const config cfg)
static

Definition at line 125 of file statistics.cpp.

References config::attribute_range(), and i.

Referenced by statistics::stats::read(), and read_battle_result_map().

static config write_battle_result_map ( const stats::battle_result_map &  m)
static

Definition at line 135 of file statistics.cpp.

References config::add_child(), i, and write_str_int_map().

Referenced by statistics::stats::write().

static void write_battle_result_map ( config_writer out,
const stats::battle_result_map &  m 
)
static
static config write_str_int_map ( const stats::str_int_map &  m)
static

Definition at line 108 of file statistics.cpp.

References i.

Referenced by statistics::stats::write(), and write_battle_result_map().

static void write_str_int_map ( config_writer out,
const stats::str_int_map &  m 
)
static

Definition at line 118 of file statistics.cpp.

References i, and config_writer::write_key_val().

Variable Documentation

lg::log_domain log_engine("engine")
static