19 #ifndef HEADER_SUPERTUX_SUPERTUX_STATISTICS_HPP 20 #define HEADER_SUPERTUX_SUPERTUX_STATISTICS_HPP 22 #include "video/color.hpp" 23 #include "video/surface_ptr.hpp" 35 static Color header_color;
36 static Color text_color;
39 static std::string coins_to_string(
int coins,
int total_coins);
40 static std::string frags_to_string(
int badguys,
int total_badguys);
41 static std::string time_to_string(
float time);
42 static std::string secrets_to_string(
int secrets,
int total_secrets);
45 enum Status { INVALID, ACCUMULATING, FINAL };
59 void init(
const Level& level);
60 void finish(
float time);
63 Status get_status()
const {
return m_status; }
67 bool completed(
const Statistics& stats,
const float target_time)
const;
69 float get_time()
const {
return m_time; }
72 void calculate_max_caption_length();
93 std::string CAPTION_MAX_COINS;
94 std::string CAPTION_MAX_FRAGGING;
95 std::string CAPTION_MAX_SECRETS;
96 std::string CAPTION_BEST_TIME;
97 std::string CAPTION_TARGET_TIME;
99 float WMAP_INFO_LEFT_X;
100 float WMAP_INFO_RIGHT_X;
101 float WMAP_INFO_TOP_Y1;
102 float WMAP_INFO_TOP_Y2;
void unserialize_from_squirrel(SquirrelVM &vm)
unserialize statistics object from squirrel table "statistics"
Definition: statistics.cpp:102
void serialize_to_squirrel(SquirrelVM &vm) const
serialize statistics object as squirrel table "statistics"
Definition: statistics.cpp:86
int m_secrets
secret areas found
Definition: statistics.hpp:84
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:32
int m_total_coins
coins in level
Definition: statistics.hpp:78
int m_badguys
badguys actively killed
Definition: statistics.hpp:83
void draw_worldmap_info(DrawingContext &context, float target_time)
draw worldmap stat HUD
Definition: statistics.cpp:125
Represents a collection of Sectors running in a single GameSession.
Definition: level.hpp:29
void update(const Statistics &stats)
Given another Statistics object finds the best of each one.
Definition: statistics.cpp:281
Statistics()
Creates new statistics, call reset() before counting.
Definition: statistics.cpp:37
Basic wrapper around HSQUIRRELVM with some utility functions, not to be confused with SquirrelVirtual...
Definition: squirrel_vm.hpp:29
int m_total_secrets
secret areas in level
Definition: statistics.hpp:80
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:79
void draw_endseq_panel(DrawingContext &context, Statistics *best_stats, const SurfacePtr &backdrop)
draw panel shown during level's end sequence
Definition: statistics.cpp:187
int m_coins
coins collected
Definition: statistics.hpp:82