Classes | |
struct | attack_context |
struct | scenario_context |
struct | stats |
Typedefs | |
typedef std::vector< std::pair< const std::string *, const stats * > > | levels |
Stats (and name) for each scenario. More... | |
Functions | |
void | recruit_unit (const unit &u) |
void | recall_unit (const unit &u) |
void | un_recall_unit (const unit &u) |
void | un_recruit_unit (const unit &u) |
int | un_recall_unit_cost (const unit &u) |
void | advance_unit (const unit &u) |
void | reset_turn_stats (const std::string &save_id) |
stats | calculate_stats (const std::string &save_id) |
levels | level_stats (const std::string &save_id) |
Returns a list of names and stats for each scenario in the current campaign. More... | |
config | write_stats () |
void | write_stats (config_writer &out) |
void | read_stats (const config &cfg) |
void | fresh_stats () |
void | clear_current_scenario () |
Delete the current scenario from the stats. More... | |
void | reset_current_scenario () |
Reset the stats of the current scenario to the beginning. More... | |
int | sum_str_int_map (const stats::str_int_map &m) |
int | sum_cost_str_int_map (const stats::str_int_map &m) |
typedef std::vector< std::pair<const std::string *, const stats *> > statistics::levels |
Stats (and name) for each scenario.
The pointers are never nullptr.
Definition at line 136 of file statistics.hpp.
void statistics::advance_unit | ( | const unit & | u | ) |
Definition at line 681 of file statistics.cpp.
References statistics::stats::advanced_to, get_stats(), s, and unit::type_id().
Referenced by advance_unit().
stats statistics::calculate_stats | ( | const std::string & | save_id | ) |
Definition at line 699 of file statistics.cpp.
References DBG_NG, i, and merge_stats().
void statistics::clear_current_scenario | ( | ) |
Delete the current scenario from the stats.
Definition at line 789 of file statistics.cpp.
Referenced by game_launcher::load_game().
void statistics::fresh_stats | ( | ) |
Definition at line 783 of file statistics.cpp.
Referenced by do_gameloop(), gui2::dialogs::mp_join_game::post_show(), read_stats(), saved_game::set_data(), and mp::start_local_game_commandline().
levels statistics::level_stats | ( | const std::string & | save_id | ) |
Returns a list of names and stats for each scenario in the current campaign.
The front of the list is the oldest scenario; the back of the list is the (most) current scenario. Only scenarios with stats for the given side_id are included, but if no scenarios are applicable, then a vector containing a single dummy entry will be returned. (I.e., this never returns an empty vector.) This list is intended for the statistics dialog and may become invalid if new stats are recorded.
Definition at line 726 of file statistics.cpp.
References game_config::images::level.
void statistics::read_stats | ( | const config & | cfg | ) |
Definition at line 773 of file statistics.cpp.
References config::child_range(), fresh_stats(), and s.
Referenced by playsingle_controller::play_scenario_main_loop(), gui2::dialogs::mp_join_game::post_show(), and saved_game::set_data().
void statistics::recall_unit | ( | const unit & | u | ) |
Definition at line 654 of file statistics.cpp.
References unit::cost(), get_stats(), statistics::stats::recall_cost, statistics::stats::recalls, s, and unit::type_id().
Referenced by actions::recall_unit().
void statistics::recruit_unit | ( | const unit & | u | ) |
Definition at line 647 of file statistics.cpp.
References unit::cost(), get_stats(), unit_type::parent_id(), statistics::stats::recruit_cost, statistics::stats::recruits, s, and unit::type().
Referenced by actions::recruit_unit().
void statistics::reset_current_scenario | ( | ) |
Reset the stats of the current scenario to the beginning.
Definition at line 797 of file statistics.cpp.
Referenced by playsingle_controller::play_scenario_main_loop().
void statistics::reset_turn_stats | ( | const std::string & | save_id | ) |
Definition at line 687 of file statistics.cpp.
References get_stats(), s, statistics::stats::save_id, statistics::stats::turn_by_cth_inflicted, statistics::stats::turn_by_cth_taken, statistics::stats::turn_damage_inflicted, statistics::stats::turn_damage_taken, statistics::stats::turn_expected_damage_inflicted, and statistics::stats::turn_expected_damage_taken.
Referenced by play_controller::play_side().
int statistics::sum_cost_str_int_map | ( | const stats::str_int_map & | m | ) |
Definition at line 814 of file statistics.cpp.
References unit_type::cost(), ERR_NG, unit_type_data::find(), i, t, and unit_types.
Referenced by gui2::dialogs::statistics_dialog::add_stat_row().
int statistics::sum_str_int_map | ( | const stats::str_int_map & | m | ) |
Definition at line 804 of file statistics.cpp.
References i.
Referenced by gui2::dialogs::statistics_dialog::add_stat_row().
void statistics::un_recall_unit | ( | const unit & | u | ) |
Definition at line 661 of file statistics.cpp.
References unit::cost(), get_stats(), statistics::stats::recall_cost, statistics::stats::recalls, s, and unit::type_id().
Referenced by actions::undo::recall_action::undo().
int statistics::un_recall_unit_cost | ( | const unit & | u | ) |
Definition at line 675 of file statistics.cpp.
References unit::recall_cost().
Referenced by wb::recall::draw_hex(), and actions::undo::recall_action::undo().
void statistics::un_recruit_unit | ( | const unit & | u | ) |
Definition at line 668 of file statistics.cpp.
References unit::cost(), get_stats(), unit_type::parent_id(), statistics::stats::recruit_cost, statistics::stats::recruits, s, and unit::type().
Referenced by actions::undo::recruit_action::undo().
config statistics::write_stats | ( | ) |
Definition at line 750 of file statistics.cpp.
References config::add_child(), and i.
Referenced by savegame::savegame::write_game().
void statistics::write_stats | ( | config_writer & | out | ) |
Definition at line 762 of file statistics.cpp.
References config_writer::close_child(), i, config_writer::open_child(), and config_writer::write_key_val().