Split of the line buffer from Console into ConsoleBuffer class
[supertux.git] / src / supertux / statistics.hpp
index 450f03d..964b055 100644 (file)
 #include <squirrel.h>
 
 #include "video/color.hpp"
+#include "video/surface_ptr.hpp"
 
 namespace lisp { class Writer; }
 namespace lisp { class Lisp; }
-class Surface;
 class DrawingContext;
 
 /** This class is a layer between level and worldmap to keep
@@ -48,11 +48,6 @@ public:
   Statistics(); /**< Creates new statistics, call reset() before counting */
   ~Statistics();
 
-  /// read statistics from lisp file
-  //void parse(const Reader& lisp);
-  /// write statistics to lisp file
-  //void write(lisp::Writer& writer);
-
   /**
    * serialize statistics object as squirrel table "statistics"
    */
@@ -63,16 +58,17 @@ public:
    */
   void unserialize_from_squirrel(HSQUIRRELVM vm);
 
-  void draw_worldmap_info(DrawingContext& context); /**< draw worldmap stat HUD */
-  void draw_endseq_panel(DrawingContext& context, Statistics* best_stats, Surface* backdrop); /**< draw panel shown during level's end sequence */
+  void draw_worldmap_info(DrawingContext& context, float target_time); /**< draw worldmap stat HUD */
+  void draw_endseq_panel(DrawingContext& context, Statistics* best_stats, SurfacePtr 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(const Statistics& stats); /**< Given another Statistics object finds the best of each one */
   void operator+=(const Statistics& o); /**< Add two Statistics objects */
+  bool completed(const Statistics& stats, const float target_time); /* Check if stats match total stats */
 
   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);