20 #ifndef HEADER_SUPERTUX_SUPERTUX_STATISTICS_HPP 21 #define HEADER_SUPERTUX_SUPERTUX_STATISTICS_HPP 23 #include "video/color.hpp" 24 #include "video/surface_ptr.hpp" 39 static Color header_color;
40 static Color text_color;
41 static Color perfect_color;
44 static std::string coins_to_string(
int coins,
int total_coins);
45 static std::string frags_to_string(
int badguys,
int total_badguys);
46 static std::string time_to_string(
float time);
47 static std::string secrets_to_string(
int secrets,
int total_secrets);
50 enum Status { INVALID, ACCUMULATING, FINAL };
56 void serialize_to_squirrel(ssq::Table& table)
const;
59 void unserialize_from_squirrel(
const ssq::Table& table);
61 void draw_worldmap_info(
DrawingContext& context,
float target_time);
62 void draw_endseq_panel(
DrawingContext& context,
Statistics* best_stats,
const SurfacePtr& backdrop,
float target_time);
63 void draw_ingame_stats(
DrawingContext& context,
bool on_pause_menu);
66 void update_timers(
float dt_sec);
68 void init(
const Level& level);
69 void finish(
float time);
73 bool completed(
const Statistics& stats,
const float target_time)
const;
75 int get_coins()
const {
return m_coins; }
76 int get_badguys()
const {
return m_badguys; }
77 int get_secrets()
const {
return m_secrets; }
78 float get_time()
const {
return m_time; }
79 Status get_status()
const {
return m_status; }
81 void increment_coins() { m_coins++; check_coins(); }
82 void increment_badguys() { m_badguys++; check_badguys(); }
83 void increment_secrets() { m_secrets++; check_secrets(); }
86 void calculate_max_caption_length();
107 bool m_cleared_coins,
119 std::string CAPTION_MAX_COINS;
120 std::string CAPTION_MAX_FRAGGING;
121 std::string CAPTION_MAX_SECRETS;
122 std::string CAPTION_BEST_TIME;
123 std::string CAPTION_TARGET_TIME;
125 float WMAP_INFO_LEFT_X;
126 float WMAP_INFO_RIGHT_X;
127 float WMAP_INFO_TOP_Y1;
128 float WMAP_INFO_TOP_Y2;
130 SurfacePtr coin_icon;
131 SurfacePtr badguy_icon;
132 SurfacePtr secret_icon;
This class is a layer between level and worldmap to keep track of stuff like scores, and minor, but funny things, like number of jumps and stuff.
Definition: statistics.hpp:36
int m_total_coins
coins in level
Definition: statistics.hpp:96
Definition: path_object.hpp:28
Represents a collection of Sectors running in a single GameSession.
Definition: level.hpp:30
int m_total_secrets
secret areas in level
Definition: statistics.hpp:98
This class provides functions for drawing things on screen.
Definition: drawing_context.hpp:42
int m_total_badguys
(vincible) badguys in level
Definition: statistics.hpp:97