X-Git-Url: https://git.verplant.org/?a=blobdiff_plain;f=src%2Fstatistics.h;h=9f1533236406b2e0cdc2aedb9e068e6ba4210cff;hb=f41a5719a2dc1a50674c69fa511c38a152cc4b03;hp=8ffb4e49fe9008a1afb22fc19a17af017a67f23c;hpb=36109a71ec561ea0fbd2e3c81d35488123921b59;p=supertux.git diff --git a/src/statistics.h b/src/statistics.h index 8ffb4e49f..9f1533236 100644 --- a/src/statistics.h +++ b/src/statistics.h @@ -20,7 +20,7 @@ #ifndef SUPERTUX_STATISTICS_H #define SUPERTUX_STATISTICS_H -#include "special/timer.h" +#include "timer.h" using namespace SuperTux; @@ -30,12 +30,14 @@ class LispWriter; class DrawingContext; } +#define SPLAYER 0 +#define STOTAL 1 + enum { SCORE_STAT, - BADGUYS_SQUISHED_STAT, - SHOTS_STAT, + COINS_COLLECTED_STAT, + BADGUYS_KILLED_STAT, TIME_NEEDED_STAT, - JUMPS_STAT, NUM_STATS }; @@ -46,6 +48,7 @@ enum { class Statistics { public: + // don't forget to call reset() to init stat Statistics(); ~Statistics(); @@ -57,13 +60,15 @@ public: /* Draw to the worldmap or a game message */ // TODO: make this functions working void draw_worldmap_info(DrawingContext& context); - void draw_message_info(DrawingContext& context); + void draw_message_info(DrawingContext& context, std::string title); /* Add / Set / Get points to/from one of the stats this can keep track of */ void add_points(int stat, int points); void set_points(int stat, int points); int get_points(int stat); + void set_total_points(int stat, int points); + /* Reset statistics */ void reset(); @@ -74,9 +79,9 @@ public: void operator+=(const Statistics& o); private: - int stats[NUM_STATS]; + int stats[NUM_STATS][2]; - Timer timer; + Timer2 timer; int display_stat; };