X-Git-Url: https://git.verplant.org/?a=blobdiff_plain;f=src%2Fstatistics.h;h=bb123734bd2b3a2e9c1ceaea43687214dc2dcc2d;hb=e4db6eb50cd6bcba607858b5e6c4c5d53531ed1f;hp=37567ed728bbda92b2458def4100cdd415572727;hpb=03bc45b5d64e7295cb64a30116c9dbf90c0a0c7a;p=supertux.git diff --git a/src/statistics.h b/src/statistics.h index 37567ed72..bb123734b 100644 --- a/src/statistics.h +++ b/src/statistics.h @@ -20,6 +20,8 @@ #ifndef SUPERTUX_STATISTICS_H #define SUPERTUX_STATISTICS_H +#include "special/timer.h" + using namespace SuperTux; namespace SuperTux { @@ -28,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 }; @@ -44,6 +48,7 @@ enum { class Statistics { public: + // don't forget to call reset() to init stat Statistics(); ~Statistics(); @@ -55,13 +60,16 @@ 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_points(int stat, int points); + void set_total_points(int stat, int points); + /* Reset statistics */ void reset(); /* Give another Statistics object, find the best of each one */ @@ -71,7 +79,10 @@ public: void operator+=(const Statistics& o); private: - int stats[NUM_STATS]; + int stats[NUM_STATS][2]; + + Timer timer; + int display_stat; }; extern Statistics global_stats;