X-Git-Url: https://git.verplant.org/?a=blobdiff_plain;f=src%2Fstatistics.hpp;h=a6c6c3766c9b0cf2b178cf2a354ceae1e092b7dd;hb=43db9a6c44b6ee544e7694d1bb234ba559b0849c;hp=4aca2ad96778b44562ea97e2e58aab397e368aa2;hpb=4a308ce51f1300ad7c9c041272521f6df71036de;p=supertux.git diff --git a/src/statistics.hpp b/src/statistics.hpp index 4aca2ad96..a6c6c3766 100644 --- a/src/statistics.hpp +++ b/src/statistics.hpp @@ -23,7 +23,7 @@ #define SUPERTUX_STATISTICS_H #include -#include "timer.hpp" +#include "video/color.hpp" namespace lisp { class Writer; } namespace lisp { class Lisp; } @@ -35,6 +35,8 @@ class DrawingContext; * number of jumps and stuff */ class Statistics { + static Color header_color; + static Color text_color; public: int coins; /**< coins collected */ int total_coins; /**< coins in level */ @@ -64,20 +66,23 @@ public: void unserialize_from_squirrel(HSQUIRRELVM vm); void draw_worldmap_info(DrawingContext& context); /**< draw worldmap stat HUD */ - void draw_message_info(DrawingContext& context, std::string title); /**< draw stats at level start */ void draw_endseq_panel(DrawingContext& context, Statistics* best_stats, Surface* backdrop); /**< draw panel shown during level's end sequence */ void zero(); /**< Set stats to zero */ void reset(); /**< Set stats (but not totals) to zero */ - void merge(Statistics& stats); /**< Given another Statistics object finds the best of each one */ + void merge(const Statistics& stats); /**< Given another Statistics object finds the best of each one */ void operator+=(const Statistics& o); /**< Add two Statistics objects */ void declare_invalid(); /**< marks statistics as invalid for their entire lifetime (e.g. after cheating). Invalid statistics will not be merged or drawn. */ + + static std::string coins_to_string(int coins, int total_coins); + static std::string frags_to_string(int badguys, int total_badguys); + static std::string time_to_string(float time); + static std::string secrets_to_string(int secrets, int total_secrets); private: - bool valid; /**< stores whether this statistics can be trusted */ - Timer timer; /**< for draw_worldmap_info: time until switching to next stat */ - int display_stat; /**< for draw_worldmap_info: which stat is currently displayed */ + bool valid; /**< stores whether these statistics can be trusted */ + }; #endif /*SUPERTUX_STATISTICS_H*/