supertux
Public Types | Public Member Functions | Static Public Member Functions | Public Attributes | List of all members
Statistics Class Referencefinal

This class is a layer between level and worldmap to keep track of stuff like scores, and minor, but funny things, like number of jumps and stuff. More...

#include <statistics.hpp>

Public Types

enum  Status { INVALID, ACCUMULATING, FINAL }
 

Public Member Functions

 Statistics ()
 Creates new statistics, call reset() before counting.
 
void serialize_to_squirrel (SquirrelVM &vm) const
 serialize statistics object as squirrel table "statistics"
 
void unserialize_from_squirrel (SquirrelVM &vm)
 unserialize statistics object from squirrel table "statistics"
 
void draw_worldmap_info (DrawingContext &context, float target_time)
 draw worldmap stat HUD
 
void draw_endseq_panel (DrawingContext &context, Statistics *best_stats, const SurfacePtr &backdrop)
 draw panel shown during level's end sequence
 
void init (const Level &level)
 
void finish (float time)
 
void invalidate ()
 
Status get_status () const
 
void update (const Statistics &stats)
 Given another Statistics object finds the best of each one.
 
bool completed (const Statistics &stats, const float target_time) const
 
float get_time () const
 

Static Public Member Functions

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)
 
static std::string secrets_to_string (int secrets, int total_secrets)
 

Public Attributes

int m_total_coins
 coins in level
 
int m_total_badguys
 (vincible) badguys in level
 
int m_total_secrets
 secret areas in level
 
int m_coins
 coins collected
 
int m_badguys
 badguys actively killed
 
int m_secrets
 secret areas found
 

Detailed Description

This class is a layer between level and worldmap to keep track of stuff like scores, and minor, but funny things, like number of jumps and stuff.


The documentation for this class was generated from the following files: