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. The pointers are never nullptr. 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 () |
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 115 of file statistics.hpp.
Definition at line 516 of file statistics.cpp.
References statistics::stats::advanced_to, get_stats(), and unit::type_id().
Referenced by advance_unit().
stats statistics::calculate_stats | ( | const std::string & | save_id | ) |
Definition at line 532 of file statistics.cpp.
References DBG_NG, i, and merge_stats().
void statistics::clear_current_scenario | ( | ) |
Definition at line 623 of file statistics.cpp.
Referenced by game_launcher::load_game().
void statistics::fresh_stats | ( | ) |
Definition at line 617 of file statistics.cpp.
Referenced by do_gameloop(), enter_connect_mode(), enter_wait_mode(), read_stats(), saved_game::set_data(), mp::wait::start_game(), 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 559 of file statistics.cpp.
Definition at line 607 of file statistics.cpp.
References config::child_range(), and fresh_stats().
Referenced by saved_game::set_data(), and mp::wait::start_game().
Definition at line 487 of file statistics.cpp.
References unit::cost(), get_stats(), statistics::stats::recall_cost, statistics::stats::recalls, and unit::type_id().
Referenced by actions::recall_unit().
Definition at line 480 of file statistics.cpp.
References unit_type::base_id(), unit::cost(), get_stats(), statistics::stats::recruit_cost, statistics::stats::recruits, and unit::type().
Referenced by actions::recruit_unit().
void statistics::reset_turn_stats | ( | const std::string & | save_id | ) |
Definition at line 522 of file statistics.cpp.
References get_stats(), statistics::stats::save_id, 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 641 of file statistics.cpp.
References unit_type::cost(), ERR_NG, unit_type_data::find(), i, and unit_types.
Referenced by statistics_dialog::display_stats().
int statistics::sum_str_int_map | ( | const stats::str_int_map & | m | ) |
Definition at line 631 of file statistics.cpp.
References i.
Referenced by statistics_dialog::display_stats().
Definition at line 494 of file statistics.cpp.
References unit::cost(), get_stats(), statistics::stats::recall_cost, statistics::stats::recalls, and unit::type_id().
Referenced by actions::undo::recall_action::undo().
Definition at line 508 of file statistics.cpp.
References get_stats(), unit::recall_cost(), statistics::stats::recalls, and unit::type_id().
Referenced by wb::recall::draw_hex(), and actions::undo::recall_action::undo().
Definition at line 501 of file statistics.cpp.
References unit_type::base_id(), unit::cost(), get_stats(), statistics::stats::recruit_cost, statistics::stats::recruits, and unit::type().
Referenced by actions::undo::recruit_action::undo().
config statistics::write_stats | ( | ) |
Definition at line 584 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 596 of file statistics.cpp.
References config_writer::close_child(), i, config_writer::open_child(), and config_writer::write_key_val().