2 // SuperTux - A Jump'n Run
3 // Copyright (C) 2004 Ricardo Cruz <rick2@aeiou.pt>
5 // This program is free software; you can redistribute it and/or
6 // modify it under the terms of the GNU General Public License
7 // as published by the Free Software Foundation; either version 2
8 // of the License, or (at your option) any later version.
10 // This program is distributed in the hope that it will be useful,
11 // but WITHOUT ANY WARRANTY; without even the implied warranty of
12 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 // GNU General Public License for more details.
15 // You should have received a copy of the GNU General Public License
16 // along with this program; if not, write to the Free Software
17 // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
20 #ifndef SUPERTUX_STATISTICS_H
21 #define SUPERTUX_STATISTICS_H
24 #include "lisp/lisp.hpp"
25 #include "lisp/writer.hpp"
40 /** This class is a layer between level and worldmap to keep
41 * track of stuff like scores, and minor, but funny things, like
42 * number of jumps and stuff */
47 // don't forget to call reset() to init stat
51 /// read statistics from lisp file
52 void parse(const lisp::Lisp& lisp);
53 /// write statistics to lisp file
54 void write(lisp::Writer& writer);
56 /* Draw to the worldmap or a game message */
57 // TODO: make this functions working
58 void draw_worldmap_info(DrawingContext& context);
59 void draw_message_info(DrawingContext& context, std::string title);
61 /* Add / Set / Get points to/from one of the stats this can keep track of */
62 void add_points(int stat, int points);
63 void set_points(int stat, int points);
64 int get_points(int stat);
66 void set_total_points(int stat, int points);
68 /* Reset statistics */
71 /* Give another Statistics object, find the best of each one */
72 void merge(Statistics& stats);
74 /* Add two statistic objects */
75 void operator+=(const Statistics& o);
78 int stats[NUM_STATS][2];
84 extern Statistics global_stats;
86 #endif /*SUPERTUX_STATISTICS_H*/