00001 #ifndef HEADER_PEDOMETER_H 00002 #define HEADER_PEDOMETER_H 00003 00004 class Level; 00005 class LevelStatus; 00006 class LayeredPicture; 00007 class Picture; 00008 00009 #include "Drawable.h" 00010 #include "GameState.h" 00011 00012 #include "SDL.h" 00013 #include <string> 00014 00015 /** 00016 * Pedometer with tree buttons. 00017 */ 00018 class Pedometer : public GameState, public Drawable { 00019 private: 00020 Picture *m_bg; 00021 LayeredPicture *m_rack; 00022 SDL_Surface *m_numbers; 00023 LevelStatus *m_status; 00024 Level *m_level; 00025 Uint32 m_activeMask; 00026 Uint32 m_maskRun; 00027 Uint32 m_maskReplay; 00028 Uint32 m_maskCancel; 00029 std::string m_solution; 00030 int m_meterPhase; 00031 private: 00032 void prepareBg(); 00033 void prepareRack(); 00034 00035 void watchCursor(); 00036 void runLevel(); 00037 void runReplay(); 00038 00039 void drawNumbers(SDL_Surface *screen, int value); 00040 void drawNumber(SDL_Surface *screen, int x, int y, int shiftY); 00041 protected: 00042 virtual void own_initState(); 00043 virtual void own_updateState(); 00044 virtual void own_pauseState() {} 00045 virtual void own_resumeState() {} 00046 virtual void own_cleanState() {} 00047 public: 00048 Pedometer(LevelStatus *status, Level *level); 00049 virtual ~Pedometer(); 00050 virtual const char *getName() const { return "state_pedometer"; }; 00051 00052 void runSelected(); 00053 virtual void drawOn(SDL_Surface *screen); 00054 void receiveString(const StringMsg *msg); 00055 }; 00056 00057 #endif