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