statistics.cpp File Reference

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

#include "global.hpp"
#include "config.hpp"
#include "statistics.hpp"
#include "util.hpp"
#include "log.hpp"
#include "serialization/binary_or_text.hpp"
#include "unit.hpp"

Include dependency graph for statistics.cpp:

Go to the source code of this file.

Namespaces

namespace  statistics

Defines

#define ERR_NG   lg::err(lg::engine)

Typedefs

typedef statistics::stats stats

Functions

static statsget_stats (int team)
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)
void statistics::advance_unit (const unit &u)
void statistics::reset_turn_stats (int side)
stats statistics::calculate_stats (int category, int side)
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)

Variables

bool mid_scenario = false
int stats_disabled = 0
std::vector< scenario_stats > master_stats


Detailed Description

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

Definition in file statistics.cpp.


Define Documentation

#define ERR_NG   lg::err(lg::engine)

Definition at line 26 of file statistics.cpp.


Typedef Documentation

typedef statistics::stats stats [static]

Definition at line 34 of file statistics.cpp.


Function Documentation

static stats& get_stats ( int  team  )  [static]

static void merge_battle_result_maps ( stats::battle_result_map a,
const stats::battle_result_map b 
) [static]

Definition at line 181 of file statistics.cpp.

References merge_str_int_map().

Referenced by merge_stats().

static void merge_stats ( stats a,
const stats b 
) [static]

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

Definition at line 174 of file statistics.cpp.

Referenced by merge_battle_result_maps(), and merge_stats().

static stats::battle_result_map read_battle_result_map ( const config cfg  )  [static]

Definition at line 160 of file statistics.cpp.

References config::get_children(), read_str_int_map(), and config::values.

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

static stats::str_int_map read_str_int_map ( const config cfg  )  [static]

Definition at line 122 of file statistics.cpp.

References config::values.

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

static void write_battle_result_map ( config_writer out,
const stats::battle_result_map m 
) [static]

static config write_battle_result_map ( const stats::battle_result_map m  )  [static]

Definition at line 132 of file statistics.cpp.

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

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

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

Definition at line 113 of file statistics.cpp.

References buf, and config_writer::write_key_val().

static config write_str_int_map ( const stats::str_int_map m  )  [static]

Definition at line 101 of file statistics.cpp.

References buf.

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


Variable Documentation

std::vector<scenario_stats> master_stats [static]

bool mid_scenario = false [static]

Definition at line 32 of file statistics.cpp.

std::string scenario_name

Definition at line 49 of file statistics.cpp.

int stats_disabled = 0 [static]

Definition at line 36 of file statistics.cpp.

std::vector<stats> team_stats

Definition at line 48 of file statistics.cpp.

Referenced by get_stats().


Generated by doxygen 1.5.5 on 23 May 2008 for The Battle for Wesnoth
Gna! | Forum | Wiki | CIA | devdocs